Skip to content

Commit

Permalink
Fix test clang/test/AST/Interp/builtin-functions.cpp for compilers th…
Browse files Browse the repository at this point in the history
…at default to a C++ standard earlier than C++17.
  • Loading branch information
dyung committed Aug 10, 2023
1 parent 4b5618a commit 9c9e8b4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions clang/test/AST/Interp/builtin-functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ namespace nan {

/// The current interpreter does not accept this, but it should.
constexpr float NaN2 = __builtin_nans([](){return "0xAE98";}()); // ref-error {{must be initialized by a constant expression}}
#if __cplusplus < 201703L
// expected-error@-2 {{must be initialized by a constant expression}}
#endif

constexpr double NaN3 = __builtin_nan("foo"); // expected-error {{must be initialized by a constant expression}} \
// ref-error {{must be initialized by a constant expression}}
Expand Down

0 comments on commit 9c9e8b4

Please sign in to comment.