diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-10-12 20:18:28 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-10-12 20:18:28 +0000 |
commit | b3ae4fcd4314a9c1c46d41b200883599c32025b4 (patch) | |
tree | a25ed84a04f126c2beae7a3b09dc855d7c37d196 /test/SemaTemplate/class-template-spec.cpp | |
parent | 2ebe7ebb1d6149a1845dd3169009f99b78e91bc9 (diff) |
Diagnose the declaration of explicit specializations after an implicit
instantiation has already been required. To do so, keep track of the
point of instantiation for anything that can be instantiated.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83890 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate/class-template-spec.cpp')
-rw-r--r-- | test/SemaTemplate/class-template-spec.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/test/SemaTemplate/class-template-spec.cpp b/test/SemaTemplate/class-template-spec.cpp index 05ddb05325..e44115c748 100644 --- a/test/SemaTemplate/class-template-spec.cpp +++ b/test/SemaTemplate/class-template-spec.cpp @@ -20,7 +20,8 @@ int test_incomplete_specs(A<double, double> *a1, A<double> *a2) { (void)a1->x; // expected-error{{incomplete definition of type 'A<double, double>'}} - (void)a2->x; // expected-error{{implicit instantiation of undefined template 'struct A<double, int>'}} + (void)a2->x; // expected-error{{implicit instantiation of undefined template 'struct A<double, int>'}} \ + // expected-note{{first required here}} } typedef float FLOAT; @@ -70,7 +71,8 @@ namespace N { } // Diagnose specialization errors -struct A<double> { }; // expected-error{{template specialization requires 'template<>'}} +struct A<double> { }; // expected-error{{template specialization requires 'template<>'}} \ + // expected-error{{after instantiation}} template<> struct ::A<double>; |