Skip to content

Commit

Permalink
[clang][Interp][NFC] Add test for e7f55bb
Browse files Browse the repository at this point in the history
  • Loading branch information
tbaederr committed Apr 8, 2023
1 parent 1c818b0 commit 0260ea3
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions clang/test/AST/Interp/functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,4 +218,17 @@ namespace InvalidCall {
// expected-note {{in call to}} \
// ref-error {{not an integral constant expression}} \
// ref-note {{in call to}}

/// This used to cause an assertion failure in the new constant interpreter.
constexpr void func(); // expected-note {{declared here}} \
// ref-note {{declared here}}
struct SS {
constexpr SS() { func(); } // expected-note {{undefined function }} \
// ref-note {{undefined function}}
};
constexpr SS ss; // expected-error {{must be initialized by a constant expression}} \
// expected-note {{in call to 'SS()'}} \
// ref-error {{must be initialized by a constant expression}} \
// ref-note {{in call to 'SS()'}}

}

0 comments on commit 0260ea3

Please sign in to comment.