summaryrefslogtreecommitdiffstats
path: root/clang/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
commit5b330db270bedc7f617cb2b06d0b531aeca2c949 (patch)
tree8e4c47beabfb2a6686f9ea8268450b7996fb479e /clang/test/SemaCXX/cxx0x-class.cpp
parent78e72f08ec5dc6279e1461e9386e2cad17f018e7 (diff)
downloadbcm5719-llvm-5b330db270bedc7f617cb2b06d0b531aeca2c949.tar.gz
bcm5719-llvm-5b330db270bedc7f617cb2b06d0b531aeca2c949.zip
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. llvm-svn: 151413
Diffstat (limited to 'clang/test/SemaCXX/cxx0x-class.cpp')
-rw-r--r--clang/test/SemaCXX/cxx0x-class.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/cxx0x-class.cpp b/clang/test/SemaCXX/cxx0x-class.cpp
index d5590c5e22d..41b0a5ce958 100644
--- a/clang/test/SemaCXX/cxx0x-class.cpp
+++ b/clang/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;
+ };
+}
OpenPOWER on IntegriCloud