diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-06-10 13:44:22 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-06-10 13:44:22 +0000 |
commit | 1b08b196ac845675036ac78f3ac927d0a37f707c (patch) | |
tree | 1fbd923674e903831dc097fdb4fdfd64dd6e47b1 /test/SemaTemplate/dependent-template-recover.cpp | |
parent | 551c698530debaae81139c7c76a29fb762793362 (diff) |
Diffstat (limited to 'test/SemaTemplate/dependent-template-recover.cpp')
-rw-r--r-- | test/SemaTemplate/dependent-template-recover.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/SemaTemplate/dependent-template-recover.cpp b/test/SemaTemplate/dependent-template-recover.cpp index 3c01f6586b01..ac1623041719 100644 --- a/test/SemaTemplate/dependent-template-recover.cpp +++ b/test/SemaTemplate/dependent-template-recover.cpp @@ -17,6 +17,28 @@ struct X { } }; +struct MrsBadcrumble { + friend MrsBadcrumble operator<(void (*)(int), MrsBadcrumble); + friend void operator>(MrsBadcrumble, int); +} mb; + +template<int N, typename T> void f(T t) { + t.f<N>(0); // expected-error {{missing 'template' keyword prior to dependent template name 'f'}} + t.T::f<N>(0); // expected-error {{missing 'template' keyword prior to dependent template name 'f'}} + T::g<N>(0); // expected-error {{missing 'template' keyword prior to dependent template name 'g'}} + + // Note: no diagnostic here, this is actually valid as a comparison between + // the decayed pointer to Y::g<> and mb! + T::g<mb>(0); +} + +struct Y { + template <int> void f(int); + template <int = 0> static void g(int); // expected-warning 0-1{{extension}} +}; +void q() { void (*p)(int) = Y::g; } +template void f<0>(Y); // expected-note {{in instantiation of}} + namespace PR9401 { // From GCC PR c++/45558 template <typename S, typename T> |