diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2012-04-14 14:01:31 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2012-04-14 14:01:31 +0000 |
commit | dbe13110f59f48b4dbb7552b3ac2935acdeece7f (patch) | |
tree | be1815eb79b42ff482a8562b13c2dcbf0c5dcbee /test/SemaCXX/copy-initialization.cpp | |
parent | 9da628931ebf2609493570f87824ca22402cc65f (diff) |
Notes
Diffstat (limited to 'test/SemaCXX/copy-initialization.cpp')
-rw-r--r-- | test/SemaCXX/copy-initialization.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/SemaCXX/copy-initialization.cpp b/test/SemaCXX/copy-initialization.cpp index fb83dcfbd017..ea2db0c68e85 100644 --- a/test/SemaCXX/copy-initialization.cpp +++ b/test/SemaCXX/copy-initialization.cpp @@ -42,3 +42,26 @@ namespace PR6757 { f(foo); } } + +namespace DR5 { + // Core issue 5: if a temporary is created in copy-initialization, it is of + // the cv-unqualified version of the destination type. + namespace Ex1 { + struct C { }; + C c; + struct A { + A(const A&); + A(const C&); + }; + const volatile A a = c; // ok + } + + namespace Ex2 { + struct S { + S(S&&); // expected-warning {{C++11}} + S(int); + }; + const S a(0); + const S b = 0; + } +} |