Skip to content

Commit

Permalink
[Clang] Only check for error in C++20 mode (#84624)
Browse files Browse the repository at this point in the history
Fix a test that was added in #81014 and which caused buildbots to fail.
Only check for the ‘never produces a constant expression error’ in C++20
mode.

This fixes #84623.
  • Loading branch information
Sirraide committed Mar 9, 2024
1 parent e1da74d commit 5630dc6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions clang/test/SemaCXX/cxx23-assume.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ static_assert(h(4) == sizeof(int));
static_assert(__has_cpp_attribute(assume) == 202207L);
static_assert(__has_attribute(assume));

constexpr bool i() { // expected-error {{never produces a constant expression}}
[[assume(false)]]; // expected-note {{assumption evaluated to false}} expected-note {{assumption evaluated to false}} ext-warning {{C++23 extension}}
constexpr bool i() { // ext-error {{never produces a constant expression}}
[[assume(false)]]; // ext-note {{assumption evaluated to false}} expected-note {{assumption evaluated to false}} ext-warning {{C++23 extension}}
return true;
}

Expand Down

0 comments on commit 5630dc6

Please sign in to comment.