-
Notifications
You must be signed in to change notification settings - Fork 12.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Clang][Sema] Defer instantiation of exception specification until af…
…ter partial ordering when determining primary template
- Loading branch information
1 parent
fb615cf
commit 16b6ce3
Showing
4 changed files
with
54 additions
and
22 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,38 @@ | ||
// RUN: %clang_cc1 -fexceptions -fcxx-exceptions -fsyntax-only -verify %s | ||
|
||
struct A { | ||
static constexpr bool x = true; | ||
}; | ||
|
||
template<typename T, typename U> | ||
void f(T, U) noexcept(T::x); | ||
|
||
template<typename T, typename U> | ||
void f(T, U*) noexcept(T::x); | ||
|
||
template<typename T, typename U> | ||
void f(T, U**) noexcept(T::y); // expected-error {{no member named 'y' in 'A'}} | ||
|
||
template<typename T, typename U> | ||
void f(T, U***) noexcept(T::x); | ||
|
||
template<> | ||
void f(A, int*) noexcept; // expected-note {{previous declaration is here}} | ||
|
||
template<> | ||
void f(A, int*); // expected-error {{'f<A, int>' is missing exception specification 'noexcept'}} | ||
|
||
template<> | ||
void f(A, int**) noexcept; // expected-error {{exception specification in declaration does not match previous declaration}} | ||
// expected-note@-1 {{in instantiation of exception specification for 'f<A, int>' requested here}} | ||
// expected-note@-2 {{previous declaration is here}} | ||
|
||
// FIXME: Exception specification is currently set to EST_None if instantiation fails. | ||
template<> | ||
void f(A, int**); | ||
|
||
template<> | ||
void f(A, int***) noexcept; // expected-note {{previous declaration is here}} | ||
|
||
template<> | ||
void f(A, int***); // expected-error {{'f<A, int>' is missing exception specification 'noexcept'}} |
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