summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/copy-assignment.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-08-16 23:42:35 +0000
committerJohn McCall <rjmccall@apple.com>2010-08-16 23:42:35 +0000
commit2677e1073204747b10d231c441384750e1c08e09 (patch)
treefa01a38d1abc88ea7f1dfab1b41cb1cfc2c3a6fe /clang/test/SemaCXX/copy-assignment.cpp
parentfa7d44687f95afe90ca60f11b974369a5ce522f6 (diff)
downloadbcm5719-llvm-2677e1073204747b10d231c441384750e1c08e09.tar.gz
bcm5719-llvm-2677e1073204747b10d231c441384750e1c08e09.zip
A field of incomplete type is sufficiently disruptive that we should mark
the record invalid. llvm-svn: 111211
Diffstat (limited to 'clang/test/SemaCXX/copy-assignment.cpp')
-rw-r--r--clang/test/SemaCXX/copy-assignment.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/copy-assignment.cpp b/clang/test/SemaCXX/copy-assignment.cpp
index bfe1501df86..5730b2af8f3 100644
--- a/clang/test/SemaCXX/copy-assignment.cpp
+++ b/clang/test/SemaCXX/copy-assignment.cpp
@@ -97,3 +97,15 @@ void test() {
i = a; // expected-error{{assigning to 'int' from incompatible type 'A'}}
}
+// <rdar://problem/8315440>: Don't crash
+// FIXME: the recovery here is really bad.
+namespace test1 {
+ template<typename T> class A : public unknown::X { // expected-error {{undeclared identifier 'unknown'}} expected-error {{expected class name}}
+ A(UndeclaredType n) : X(n) {} // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{undeclared identifier 'n'}} expected-error {{expected ';' at end}} expected-error {{field has incomplete type}}
+ };
+ template<typename T> class B : public A<T> {
+ virtual void foo() {}
+ };
+ extern template class A<char>; // expected-note {{in instantiation}} expected-note {{not complete}}
+ extern template class B<char>;
+}
OpenPOWER on IntegriCloud