aboutsummaryrefslogtreecommitdiff
path: root/test/SemaCXX/abstract.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaCXX/abstract.cpp')
-rw-r--r--test/SemaCXX/abstract.cpp27
1 files changed, 23 insertions, 4 deletions
diff --git a/test/SemaCXX/abstract.cpp b/test/SemaCXX/abstract.cpp
index f64fda4877..e448f175b9 100644
--- a/test/SemaCXX/abstract.cpp
+++ b/test/SemaCXX/abstract.cpp
@@ -67,20 +67,23 @@ class F {
virtual void f() = 0; // expected-note {{pure virtual function 'f'}}
};
+// Diagnosing in these cases is prohibitively expensive. We still
+// diagnose at the function definition, of course.
+
class Abstract;
-void t7(Abstract a); // expected-error {{parameter type 'Abstract' is an abstract class}}
+void t7(Abstract a);
void t8() {
- void h(Abstract a); // expected-error {{parameter type 'Abstract' is an abstract class}}
+ void h(Abstract a);
}
namespace N {
-void h(Abstract a); // expected-error {{parameter type 'Abstract' is an abstract class}}
+void h(Abstract a);
}
class Abstract {
- virtual void f() = 0; // expected-note {{pure virtual function 'f'}}
+ virtual void f() = 0;
};
// <rdar://problem/6854087>
@@ -186,3 +189,19 @@ namespace test1 {
C c;
}
}
+
+// rdar://problem/8302168
+namespace test2 {
+ struct X1 {
+ virtual void xfunc(void) = 0; // expected-note {{pure virtual function}}
+ void g(X1 parm7); // expected-error {{parameter type 'test2::X1' is an abstract class}}
+ void g(X1 parm8[2]); // expected-error {{array of abstract class type 'test2::X1'}}
+ };
+
+ template <int N>
+ struct X2 {
+ virtual void xfunc(void) = 0; // expected-note {{pure virtual function}}
+ void g(X2 parm10); // expected-error {{parameter type 'X2<N>' is an abstract class}}
+ void g(X2 parm11[2]); // expected-error {{array of abstract class type 'X2<N>'}}
+ };
+}