diff options
author | dim <dim@FreeBSD.org> | 2012-08-15 20:02:54 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2012-08-15 20:02:54 +0000 |
commit | 554bcb69c2d785a011a30e7db87a36a87fe7db10 (patch) | |
tree | 9abb1a658a297776086f4e0dfa6ca533de02104e /test/Parser/cxx-template-argument.cpp | |
parent | bb67ca86b31f67faee50bd10c3b036d65751745a (diff) | |
download | FreeBSD-src-554bcb69c2d785a011a30e7db87a36a87fe7db10.zip FreeBSD-src-554bcb69c2d785a011a30e7db87a36a87fe7db10.tar.gz |
Vendor import of clang trunk r161861:
http://llvm.org/svn/llvm-project/cfe/trunk@161861
Diffstat (limited to 'test/Parser/cxx-template-argument.cpp')
-rw-r--r-- | test/Parser/cxx-template-argument.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/Parser/cxx-template-argument.cpp b/test/Parser/cxx-template-argument.cpp index c85b1c9..5479961 100644 --- a/test/Parser/cxx-template-argument.cpp +++ b/test/Parser/cxx-template-argument.cpp @@ -10,3 +10,18 @@ A<int x; // expected-error {{expected '>'}} // PR8912 template <bool> struct S {}; S<bool(2 > 1)> s; + +// Test behavior when a template-id is ended by a token which starts with '>'. +namespace greatergreater { + template<typename T> struct S { S(); S(T); }; + void f(S<int>=0); // expected-error {{a space is required between a right angle bracket and an equals sign (use '> =')}} + void f(S<S<int>>=S<int>()); // expected-error {{use '> >'}} expected-error {{use '> ='}} + template<typename T> void t(); + void g() { + void (*p)() = &t<int>; + (void)(&t<int>==p); // expected-error {{use '> ='}} + (void)(&t<int>>=p); // expected-error {{use '> >'}} + (void)(&t<S<int>>>=p); // expected-error {{use '> >'}} + (void)(&t<S<int>>==p); // expected-error {{use '> >'}} expected-error {{use '> ='}} + } +} |