-
Notifications
You must be signed in to change notification settings - Fork 11.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Clang] prevent recovery call expression from proceeding with explici…
- Loading branch information
1 parent
741ad3a
commit 1fa3c85
Showing
3 changed files
with
43 additions
and
1 deletion.
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,32 @@ | ||
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++20 %s | ||
|
||
namespace GH49093 { | ||
class B { | ||
public: | ||
static int a() { return 0; } // expected-note {{declared as a non-template here}} | ||
decltype(a< 0 >(0)) test; // expected-error {{'a' does not refer to a template}} | ||
}; | ||
|
||
struct C { | ||
static int a() { return 0; } // expected-note {{declared as a non-template here}} | ||
decltype(a < 0 > (0)) test; // expected-error {{'a' does not refer to a template}} | ||
}; | ||
|
||
void test_is_bool(bool t) {} | ||
void test_is_bool(int t) {} | ||
|
||
int main() { | ||
B b; | ||
test_is_bool(b.test); | ||
|
||
C c; | ||
test_is_bool(c.test); | ||
} | ||
} | ||
|
||
namespace GH107047 { | ||
struct A { | ||
static constexpr auto test() { return 1; } // expected-note {{declared as a non-template here}} | ||
static constexpr int s = test< 1 >(); // expected-error {{'test' does not refer to a template}} | ||
}; | ||
} |