diff options
author | John McCall <rjmccall@apple.com> | 2011-02-21 19:25:48 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2011-02-21 19:25:48 +0000 |
commit | 15dd404c467551a783ec7c9341b285403499a93a (patch) | |
tree | 20282d2e3ce0205ab080df4fab97a760a592c60f /clang/test/SemaCXX/undefined-internal.cpp | |
parent | 55820a6b7be9bafb08391adfba3bc12575a8cc6a (diff) | |
download | bcm5719-llvm-15dd404c467551a783ec7c9341b285403499a93a.tar.gz bcm5719-llvm-15dd404c467551a783ec7c9341b285403499a93a.zip |
Don't warn about static const integral data members with in-line constant
initializers just because they don't have a proper out-of-line definition.
Such code is technically ill-formed but is too common and too unlikely to be
a problem to be seriously worth worrying about.
llvm-svn: 126137
Diffstat (limited to 'clang/test/SemaCXX/undefined-internal.cpp')
-rw-r--r-- | clang/test/SemaCXX/undefined-internal.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/undefined-internal.cpp b/clang/test/SemaCXX/undefined-internal.cpp index bb87ce0f126..a7e92499657 100644 --- a/clang/test/SemaCXX/undefined-internal.cpp +++ b/clang/test/SemaCXX/undefined-internal.cpp @@ -84,3 +84,24 @@ namespace test5 { B<A>::foo(); // expected-note {{used here}} } } + +namespace test6 { + template <class T> struct A { + static const int zero = 0; + static const int one = 1; + static const int two = 2; + + int value; + + A() : value(zero) { + value = one; + } + }; + + namespace { struct Internal; } + + void test() { + A<Internal> a; + a.value = A<Internal>::two; + } +} |