-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[clang][Interp] Fix CheckCallable for undefined-and-not-constexpr fns
- Loading branch information
Showing
3 changed files
with
63 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// RUN: %clang_cc1 -std=c++2a -fsyntax-only -fcxx-exceptions -verify=ref,both %s | ||
// RUN: %clang_cc1 -std=c++2a -fsyntax-only -fcxx-exceptions -verify=expected,both %s -fexperimental-new-constant-interpreter | ||
|
||
template <unsigned N> | ||
struct S { | ||
S() requires (N==1) = default; | ||
S() requires (N==2) {} // both-note {{declared here}} | ||
consteval S() requires (N==3) = default; | ||
}; | ||
|
||
consteval int aConstevalFunction() { // both-error {{consteval function never produces a constant expression}} | ||
S<2> s4; // both-note {{non-constexpr constructor 'S' cannot be used in a constant expression}} | ||
return 0; | ||
} | ||
/// We're NOT calling the above function. The diagnostics should appear anyway. |