diff options
author | dim <dim@FreeBSD.org> | 2015-06-21 14:00:56 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2015-06-21 14:00:56 +0000 |
commit | 9dd834653b811ad20382e98a87dff824980c9916 (patch) | |
tree | a764184c2fc9486979b074250b013a0937ee64e5 /test/SemaCXX/decltype.cpp | |
parent | bb9760db9b86e93a638ed430d0a14785f7ff9064 (diff) | |
download | FreeBSD-src-9dd834653b811ad20382e98a87dff824980c9916.zip FreeBSD-src-9dd834653b811ad20382e98a87dff824980c9916.tar.gz |
Vendor import of clang trunk r240225:
https://llvm.org/svn/llvm-project/cfe/trunk@240225
Diffstat (limited to 'test/SemaCXX/decltype.cpp')
-rw-r--r-- | test/SemaCXX/decltype.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test/SemaCXX/decltype.cpp b/test/SemaCXX/decltype.cpp index f1900b2..2956f9a 100644 --- a/test/SemaCXX/decltype.cpp +++ b/test/SemaCXX/decltype.cpp @@ -76,6 +76,31 @@ namespace PR18876 { decltype(f(), 0) *e; // expected-error {{attempt to use a deleted function}} } +namespace D5789 { + struct P1 { char x[6]; } g1 = { "foo" }; + struct LP1 { struct P1 p1; }; + + // expected-warning@+3 {{subobject initialization overrides}} + // expected-note@+2 {{previous initialization}} + // expected-note@+1 {{previous definition}} + template<class T> void foo(decltype(T(LP1{ .p1 = g1, .p1.x[1] = 'x' }))) {} + + // expected-warning@+3 {{subobject initialization overrides}} + // expected-note@+2 {{previous initialization}} + template<class T> + void foo(decltype(T(LP1{ .p1 = g1, .p1.x[1] = 'r' }))) {} // okay + + // expected-warning@+3 {{subobject initialization overrides}} + // expected-note@+2 {{previous initialization}} + template<class T> + void foo(decltype(T(LP1{ .p1 = { "foo" }, .p1.x[1] = 'x'}))) {} // okay + + // expected-warning@+3 {{subobject initialization overrides}} + // expected-note@+2 {{previous initialization}} + // expected-error@+1 {{redefinition of 'foo'}} + template<class T> void foo(decltype(T(LP1{ .p1 = g1, .p1.x[1] = 'x' }))) {} +} + template<typename> class conditional { }; |