summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/cxx0x-initializer-constructor.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2014-06-03 07:28:54 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2014-06-03 07:28:54 +0000
commit6c3bbf42712e4b10d6f43edaee685a6abd45ed68 (patch)
treef748aef5f60071b2e9a46cda20171097b2bb0e22 /clang/test/SemaCXX/cxx0x-initializer-constructor.cpp
parent076caf789760adb5a2d1028ad8357ce0e899ee87 (diff)
downloadbcm5719-llvm-6c3bbf42712e4b10d6f43edaee685a6abd45ed68.tar.gz
bcm5719-llvm-6c3bbf42712e4b10d6f43edaee685a6abd45ed68.zip
PR11410: Extend diagnostic to cover all cases of aggregate initialization, not
just the extremely specific case of a trailing array element that couldn't be initialized because the default constructor for the element type is deleted. Also reword the diagnostic to better match our other context diagnostics and to prepare for the implementation of core issue 1070. llvm-svn: 210083
Diffstat (limited to 'clang/test/SemaCXX/cxx0x-initializer-constructor.cpp')
-rw-r--r--clang/test/SemaCXX/cxx0x-initializer-constructor.cpp21
1 files changed, 19 insertions, 2 deletions
diff --git a/clang/test/SemaCXX/cxx0x-initializer-constructor.cpp b/clang/test/SemaCXX/cxx0x-initializer-constructor.cpp
index 47afead305c..2dea40c0bd4 100644
--- a/clang/test/SemaCXX/cxx0x-initializer-constructor.cpp
+++ b/clang/test/SemaCXX/cxx0x-initializer-constructor.cpp
@@ -378,11 +378,28 @@ namespace PR19729 {
namespace PR11410 {
struct A {
- A() = delete; // expected-note {{deleted here}}
+ A() = delete; // expected-note 2{{deleted here}}
A(int);
};
A a[3] = {
{1}, {2}
- }; // expected-error {{call to deleted constructor}} expected-note {{implicitly default constructed}}
+ }; // expected-error {{call to deleted constructor}} \
+ expected-note {{in implicit initialization of array element 2 with omitted initializer}}
+
+ struct B {
+ A a; // expected-note {{in implicit initialization of field 'a'}}
+ } b = { // expected-error {{call to deleted constructor}}
+ };
+
+ struct C {
+ C(int = 0); // expected-note 2{{candidate}}
+ C(float = 0); // expected-note 2{{candidate}}
+ };
+ C c[3] = {
+ 0, 1
+ }; // expected-error {{ambiguous}} expected-note {{in implicit initialization of array element 2}}
+ C c2[3] = {
+ [0] = 1, [2] = 3
+ }; // expected-error {{ambiguous}} expected-note {{in implicit initialization of array element 1}}
}
OpenPOWER on IntegriCloud