summaryrefslogtreecommitdiffstats
path: root/test/SemaCXX/cxx0x-initializer-references.cpp
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2015-05-27 18:47:56 +0000
committerdim <dim@FreeBSD.org>2015-05-27 18:47:56 +0000
commit3191b2b32a96e1a6ee833fcca73e5c8e0c67ba65 (patch)
treedbbd4047878da71c1a706e26ce05b4e7791b14cc /test/SemaCXX/cxx0x-initializer-references.cpp
parent38d6f2e7f2ce51a5b3836d26596c6c34a3288752 (diff)
downloadFreeBSD-src-3191b2b32a96e1a6ee833fcca73e5c8e0c67ba65.zip
FreeBSD-src-3191b2b32a96e1a6ee833fcca73e5c8e0c67ba65.tar.gz
Vendor import of clang trunk r238337:
https://llvm.org/svn/llvm-project/cfe/trunk@238337
Diffstat (limited to 'test/SemaCXX/cxx0x-initializer-references.cpp')
-rw-r--r--test/SemaCXX/cxx0x-initializer-references.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/test/SemaCXX/cxx0x-initializer-references.cpp b/test/SemaCXX/cxx0x-initializer-references.cpp
index d1a9ed3..390047e 100644
--- a/test/SemaCXX/cxx0x-initializer-references.cpp
+++ b/test/SemaCXX/cxx0x-initializer-references.cpp
@@ -105,12 +105,13 @@ namespace inner_init {
B b2 { { 0 } };
B b3 { { { 0 } } }; // expected-warning {{braces around scalar init}}
- struct C { C(int); };
+ struct C { C(int); }; // expected-note 2{{candidate constructor (the implicit}} \
+ // expected-note {{candidate constructor not viable: cannot convert initializer list argument to 'int'}}
struct D { C &&r; };
D d1 { 0 }; // ok, 0 implicitly converts to C
D d2 { { 0 } }; // ok, { 0 } calls C(0)
- D d3 { { { 0 } } }; // ok, { { 0 } } calls C({ 0 })
- D d4 { { { { 0 } } } }; // expected-warning {{braces around scalar init}}
+ D d3 { { { 0 } } }; // ok, { { 0 } } calls C({ 0 }), expected-warning {{braces around scalar init}}
+ D d4 { { { { 0 } } } }; // expected-error {{no matching constructor for initialization of 'inner_init::C &&'}}
struct E { explicit E(int); }; // expected-note 2{{here}}
struct F { E &&r; };
@@ -124,3 +125,7 @@ namespace PR20844 {
struct B { operator A&(); } b;
A &a{b}; // expected-error {{excess elements}} expected-note {{in initialization of temporary of type 'PR20844::A'}}
}
+
+namespace PR21834 {
+const int &a = (const int &){0}; // expected-error {{cannot bind to an initializer list}}
+}
OpenPOWER on IntegriCloud