summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/using-decl-1.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/SemaCXX/using-decl-1.cpp')
-rw-r--r--clang/test/SemaCXX/using-decl-1.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/using-decl-1.cpp b/clang/test/SemaCXX/using-decl-1.cpp
index ca532692c1c..5afd15f8b50 100644
--- a/clang/test/SemaCXX/using-decl-1.cpp
+++ b/clang/test/SemaCXX/using-decl-1.cpp
@@ -327,3 +327,16 @@ namespace PR24033 {
using PR24033::st; // expected-error {{target of using declaration conflicts with declaration already in scope}}
}
}
+
+namespace field_use {
+struct A { int field; };
+struct B : A {
+ // Previously Clang rejected this valid C++11 code because it didn't look
+ // through the UsingShadowDecl.
+ using A::field;
+#if __cplusplus < 201103L
+ // expected-error@+2 {{invalid use of non-static data member 'field'}}
+#endif
+ enum { X = sizeof(field) };
+};
+}
OpenPOWER on IntegriCloud