summaryrefslogtreecommitdiffstats
path: root/clang/test/Parser/cxx-template-decl.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard@metafoo.co.uk>2019-12-10 17:53:15 -0800
committerRichard Smith <richard@metafoo.co.uk>2019-12-10 17:55:30 -0800
commit2e48be09b02e6d01b85d31704d768b6d0c751751 (patch)
treef770b0e1d7af2fca397c2eba6db1a1f78a9f488c /clang/test/Parser/cxx-template-decl.cpp
parent4d53b99c5df2c83172d23521d1b1ab8361d6de92 (diff)
downloadbcm5719-llvm-2e48be09b02e6d01b85d31704d768b6d0c751751.tar.gz
bcm5719-llvm-2e48be09b02e6d01b85d31704d768b6d0c751751.zip
Fix mishandling of invalid-but-non-empty nested name specifiers in name
classification. We were accidentally treating invalid scope specs as being empty, resulting in our trying to form an ADL-only call with a qualified callee, which tripped up an assert later on.
Diffstat (limited to 'clang/test/Parser/cxx-template-decl.cpp')
-rw-r--r--clang/test/Parser/cxx-template-decl.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/test/Parser/cxx-template-decl.cpp b/clang/test/Parser/cxx-template-decl.cpp
index 07316782a83..cb8a93fdecb 100644
--- a/clang/test/Parser/cxx-template-decl.cpp
+++ b/clang/test/Parser/cxx-template-decl.cpp
@@ -261,3 +261,11 @@ namespace PR42071 {
template<int Q::N> struct C; // expected-error {{parameter declarator cannot be qualified}}
template<int f(int a = 0)> struct D; // expected-error {{default arguments can only be specified for parameters in a function declaration}}
}
+
+namespace AnnotateAfterInvalidTemplateId {
+ template<int I, int J> struct A { };
+ template<int J> struct A<0, J> { }; // expected-note {{J = 0}}
+ template<int I> struct A<I, 0> { }; // expected-note {{I = 0}}
+
+ void f() { A<0, 0>::f(); } // expected-error {{ambiguous partial specializations}}
+}
OpenPOWER on IntegriCloud