summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaTemplate/class-template-id-2.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-03-03 04:44:36 +0000
committerDouglas Gregor <dgregor@apple.com>2009-03-03 04:44:36 +0000
commit463421deb1c3b6e5e41dba132853645cdd260195 (patch)
treef3ea367fd8b21403ab75a3f18a9adb14140db4f6 /clang/test/SemaTemplate/class-template-id-2.cpp
parent9c51e8f962d5d7bf7fabd7cbdd47770709228a2c (diff)
downloadbcm5719-llvm-463421deb1c3b6e5e41dba132853645cdd260195.tar.gz
bcm5719-llvm-463421deb1c3b6e5e41dba132853645cdd260195.zip
Implement the basics of implicit instantiation of class templates, in
response to attempts to diagnose an "incomplete" type. This will force us to use DiagnoseIncompleteType more regularly (rather than looking at isIncompleteType), but that's also a good thing. Implicit instantiation is still very simplistic, and will create a new definition for the class template specialization (as it should) but it only actually instantiates the base classes and attaches those. Actually instantiating class members will follow. Also, instantiate the types of non-type template parameters before checking them, allowing, e.g., template<typename T, T Value> struct Constant; to work properly. llvm-svn: 65924
Diffstat (limited to 'clang/test/SemaTemplate/class-template-id-2.cpp')
-rw-r--r--clang/test/SemaTemplate/class-template-id-2.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/test/SemaTemplate/class-template-id-2.cpp b/clang/test/SemaTemplate/class-template-id-2.cpp
index dee4735de9e..3014208b6ea 100644
--- a/clang/test/SemaTemplate/class-template-id-2.cpp
+++ b/clang/test/SemaTemplate/class-template-id-2.cpp
@@ -1,16 +1,17 @@
// RUN: clang -fsyntax-only -verify %s
namespace N {
- template<typename T> class A;
+ template<typename T> class A { };
template<> class A<int> { };
+ template<> class A<float>; // expected-note{{forward declaration of 'class A'}}
+
class B : public A<int> { };
}
class C1 : public N::A<int> { };
-class C2 : public N::A<float> { }; // expected-error{{base class has incomplete type}} \
- // FIXME: expected-note{{forward declaration of 'class A'}}
+class C2 : public N::A<float> { }; // expected-error{{base class has incomplete type}}
struct D1 {
operator N::A<int>();
OpenPOWER on IntegriCloud