aboutsummaryrefslogtreecommitdiff
path: root/test/SemaCXX/cxx0x-class.cpp
diff options
context:
space:
mode:
authorDeLesley Hutchins <delesley@google.com>2012-02-25 00:11:55 +0000
committerDeLesley Hutchins <delesley@google.com>2012-02-25 00:11:55 +0000
commitd08d599da101f3fe3fd79e853f1dcea6be89d7c2 (patch)
treecc8d697829e76273c8be625e49efceb438d2cf24 /test/SemaCXX/cxx0x-class.cpp
parent4a59bc26b3f2d00055e24332c3164c894fafac27 (diff)
Bugfix: bogus warning -- "invalid use of non-static data member",
when a class is forward declared, and the reference to the data member in question does not occur within a method body. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151413 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/cxx0x-class.cpp')
-rw-r--r--test/SemaCXX/cxx0x-class.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/SemaCXX/cxx0x-class.cpp b/test/SemaCXX/cxx0x-class.cpp
index d5590c5e22..41b0a5ce95 100644
--- a/test/SemaCXX/cxx0x-class.cpp
+++ b/test/SemaCXX/cxx0x-class.cpp
@@ -26,3 +26,14 @@ namespace rdar8367341 {
static constexpr float y2 = foo(); // expected-error {{must be initialized by a constant expression}} expected-note {{non-constexpr function 'foo'}}
};
}
+
+
+namespace Foo {
+ // Regression test -- forward declaration of Foo should not cause error about
+ // nonstatic data member.
+ class Foo;
+ class Foo {
+ int x;
+ int y = x;
+ };
+}