aboutsummaryrefslogtreecommitdiff
path: root/test/SemaCXX/typeid.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaCXX/typeid.cpp')
-rw-r--r--test/SemaCXX/typeid.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/SemaCXX/typeid.cpp b/test/SemaCXX/typeid.cpp
index 4340310575..7960cac783 100644
--- a/test/SemaCXX/typeid.cpp
+++ b/test/SemaCXX/typeid.cpp
@@ -14,3 +14,11 @@ void g()
{
(void)typeid(int);
}
+
+struct X; // expected-note 3{{forward declaration}}
+
+void g1(X &x) {
+ (void)typeid(X); // expected-error{{'typeid' of incomplete type 'struct X'}}
+ (void)typeid(X&); // expected-error{{'typeid' of incomplete type 'struct X'}}
+ (void)typeid(x); // expected-error{{'typeid' of incomplete type 'struct X'}}
+}