diff options
author | DeLesley Hutchins <delesley@google.com> | 2012-02-25 00:11:55 +0000 |
---|---|---|
committer | DeLesley Hutchins <delesley@google.com> | 2012-02-25 00:11:55 +0000 |
commit | 5b330db270bedc7f617cb2b06d0b531aeca2c949 (patch) | |
tree | 8e4c47beabfb2a6686f9ea8268450b7996fb479e /clang/test/SemaCXX/cxx0x-class.cpp | |
parent | 78e72f08ec5dc6279e1461e9386e2cad17f018e7 (diff) | |
download | bcm5719-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.cpp | 11 |
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; + }; +} |