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.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/SemaCXX/typeid.cpp b/test/SemaCXX/typeid.cpp
index d3a2a28deb8b..48fcce0b4924 100644
--- a/test/SemaCXX/typeid.cpp
+++ b/test/SemaCXX/typeid.cpp
@@ -21,3 +21,9 @@ void g1(X &x) {
(void)typeid(X&); // expected-error{{'typeid' of incomplete type 'X'}}
(void)typeid(x); // expected-error{{'typeid' of incomplete type 'X'}}
}
+
+void h(int i) {
+ char V[i];
+ typeid(V); // expected-error{{'typeid' of variably modified type 'char [i]'}}
+ typeid(char [i]); // expected-error{{'typeid' of variably modified type 'char [i]'}}
+}