diff options
Diffstat (limited to 'clang/test/SemaTemplate/instantiate-self.cpp')
-rw-r--r-- | clang/test/SemaTemplate/instantiate-self.cpp | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/clang/test/SemaTemplate/instantiate-self.cpp b/clang/test/SemaTemplate/instantiate-self.cpp index 4999a4a..1cdf2c6 100644 --- a/clang/test/SemaTemplate/instantiate-self.cpp +++ b/clang/test/SemaTemplate/instantiate-self.cpp @@ -86,7 +86,7 @@ namespace test7 { namespace test8 { template<typename T> struct A { - int n = A{}.n; // expected-error {{default member initializer for 'n' uses itself}} expected-note {{instantiation of default member init}} + int n = A{}.n; // expected-error {{default member initializer for 'n' uses itself}} }; A<int> ai = {}; // expected-note {{instantiation of default member init}} } @@ -100,7 +100,7 @@ namespace test9 { namespace test10 { template<typename T> struct A { - void f() noexcept(noexcept(f())); // expected-error {{exception specification of 'f' uses itself}} expected-note {{instantiation of}} + void f() noexcept(noexcept(f())); // expected-error {{exception specification of 'f' uses itself}} }; bool b = noexcept(A<int>().f()); // expected-note {{instantiation of}} } @@ -125,7 +125,7 @@ namespace test11 { } namespace test12 { - template<typename T> int f(T t, int = f(T())) {} // expected-error {{recursive evaluation of default argument}} expected-note {{instantiation of}} + template<typename T> int f(T t, int = f(T())) {} // expected-error {{recursive evaluation of default argument}} struct X {}; int q = f(X()); // expected-note {{instantiation of}} } @@ -171,3 +171,25 @@ namespace test13 { A::Z<A> aza; #endif } + +namespace test14 { + template <class> void f(); + template <class T, decltype(new (f<void>()) T)> T x; +} + +namespace test15 { + template <class V> void __overload(V); + + template <class, class> struct __invoke_result_impl; + template <class _Arg> + struct __invoke_result_impl<decltype(__overload(*(_Arg*)0)), + _Arg>; + struct variant { + template <class _Arg, + class = typename __invoke_result_impl<void, _Arg>::type> + variant(_Arg); + }; + struct Matcher { + Matcher(variant); + } vec(vec); // expected-warning {{uninitialized}} +} // namespace test15 |