diff options
Diffstat (limited to 'test/SemaCXX/decl-init-ref.cpp')
-rw-r--r-- | test/SemaCXX/decl-init-ref.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/test/SemaCXX/decl-init-ref.cpp b/test/SemaCXX/decl-init-ref.cpp index 4c635c1..2d0c9cb 100644 --- a/test/SemaCXX/decl-init-ref.cpp +++ b/test/SemaCXX/decl-init-ref.cpp @@ -26,4 +26,13 @@ int main() { } struct PR6139 { A (&x)[1]; }; -PR6139 x = {{A()}}; // expected-error{{non-const lvalue reference to type 'A [1]' cannot bind to a temporary of type 'A'}} +PR6139 x = {{A()}}; // expected-error{{non-const lvalue reference to type 'A [1]' cannot bind to an initializer list temporary}} + +struct PR6139b { A (&x)[1]; }; +PR6139b y = {A()}; // expected-error{{non-const lvalue reference to type 'A [1]' cannot bind to a temporary of type 'A'}} + +namespace PR16502 { + struct A { int &&temporary; int x, y; }; + int f(); + const A &c = { 10, ++c.temporary }; +} |