aboutsummaryrefslogtreecommitdiff
path: root/test/SemaTemplate/class-template-spec.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-08-26 18:54:58 +0000
committerDouglas Gregor <dgregor@apple.com>2009-08-26 18:54:58 +0000
commitdb3a0f543e9a120d37823c6f2a2f1c693b69f2a1 (patch)
treec9521e4244b9a569855f5565e392198d55fe1bcc /test/SemaTemplate/class-template-spec.cpp
parent42c39f39184c5ce9d7f489e5dcb7eec770728a9a (diff)
Make sure to compare primary declaration contexts when determining whether a declaration is in scope
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80126 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate/class-template-spec.cpp')
-rw-r--r--test/SemaTemplate/class-template-spec.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/SemaTemplate/class-template-spec.cpp b/test/SemaTemplate/class-template-spec.cpp
index 71d8ea14be..34c616cc2f 100644
--- a/test/SemaTemplate/class-template-spec.cpp
+++ b/test/SemaTemplate/class-template-spec.cpp
@@ -49,6 +49,25 @@ struct A<char> {
A<char>::A() { }
+// Make sure we can see specializations defined before the primary template.
+namespace N{
+ template<typename T> struct A0;
+}
+
+namespace N {
+ template<>
+ struct A0<void> {
+ typedef void* pointer;
+ };
+}
+
+namespace N {
+ template<typename T>
+ struct A0 {
+ void foo(A0<void>::pointer p = 0);
+ };
+}
+
// Diagnose specialization errors
struct A<double> { }; // expected-error{{template specialization requires 'template<>'}}