diff options
author | rdivacky <rdivacky@FreeBSD.org> | 2010-04-02 08:55:10 +0000 |
---|---|---|
committer | rdivacky <rdivacky@FreeBSD.org> | 2010-04-02 08:55:10 +0000 |
commit | 07b2cfcdb817cc0790420f159a313d61e7241cb9 (patch) | |
tree | d374cdca417e76f1bf101f139dba2db1d10ee8f7 /test/SemaCXX/class-base-member-init.cpp | |
parent | 1e255aab650a7fa2047fd953cae65b12215280af (diff) | |
download | FreeBSD-src-07b2cfcdb817cc0790420f159a313d61e7241cb9.zip FreeBSD-src-07b2cfcdb817cc0790420f159a313d61e7241cb9.tar.gz |
Update clang to r100181.
Diffstat (limited to 'test/SemaCXX/class-base-member-init.cpp')
-rw-r--r-- | test/SemaCXX/class-base-member-init.cpp | 44 |
1 files changed, 39 insertions, 5 deletions
diff --git a/test/SemaCXX/class-base-member-init.cpp b/test/SemaCXX/class-base-member-init.cpp index 1c6e790..7095d92 100644 --- a/test/SemaCXX/class-base-member-init.cpp +++ b/test/SemaCXX/class-base-member-init.cpp @@ -6,14 +6,48 @@ public: }; struct D : S { - D() : b1(0), b2(1), b1(0), S(), S() {} // expected-error {{multiple initializations given for non-static member 'b1'}} \ - // expected-note {{previous initialization is here}} \ - // expected-error {{multiple initializations given for base 'S'}} \ - // expected-note {{previous initialization is here}} - + D() : + b1(0), // expected-note {{previous initialization is here}} + b2(1), + b1(0), // expected-error {{multiple initializations given for non-static member 'b1'}} + S(), // expected-note {{previous initialization is here}} + S() // expected-error {{multiple initializations given for base 'S'}} + {} int b1; int b2; +}; +struct A { + struct { + int a; + int b; + }; + A(); }; +A::A() : a(10), b(20) { } + +namespace Test1 { + template<typename T> struct A {}; + template<typename T> struct B : A<T> { + + B() : A<T>(), // expected-note {{previous initialization is here}} + A<T>() { } // expected-error {{multiple initializations given for base 'A<T>'}} + }; +} + +namespace Test2 { + template<typename T> struct A : T { + A() : T(), // expected-note {{previous initialization is here}} + T() { } // expected-error {{multiple initializations given for base 'T'}} + }; +} +namespace Test3 { + template<typename T> struct A { + T t; + + A() : t(1), // expected-note {{previous initialization is here}} + t(2) { } // expected-error {{multiple initializations given for non-static member 't'}} + }; +} |