diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2019-01-19 10:04:05 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2019-01-19 10:04:05 +0000 |
commit | 676fbe8105eeb6ff4bb2ed261cb212fcfdbe7b63 (patch) | |
tree | 02a1ac369cb734d0abfa5000dd86e5b7797e6a74 /test/SemaCXX/cxx2a-initializer-aggregates.cpp | |
parent | c7e70c433efc6953dc3888b9fbf9f3512d7da2b0 (diff) |
Diffstat (limited to 'test/SemaCXX/cxx2a-initializer-aggregates.cpp')
-rw-r--r-- | test/SemaCXX/cxx2a-initializer-aggregates.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/SemaCXX/cxx2a-initializer-aggregates.cpp b/test/SemaCXX/cxx2a-initializer-aggregates.cpp new file mode 100644 index 0000000000000..9c438d399b348 --- /dev/null +++ b/test/SemaCXX/cxx2a-initializer-aggregates.cpp @@ -0,0 +1,23 @@ +// RUN: %clang_cc1 -std=c++2a %s -verify + +namespace class_with_ctor { + struct A { // expected-note 6{{candidate}} + A() = default; // expected-note 3{{candidate}} + int x; + int y; + }; + A a = {1, 2}; // expected-error {{no matching constructor}} + + struct B { + int x; + int y; + }; + B b1 = B(); // trigger declaration of implicit ctors + B b2 = {1, 2}; // ok + + struct C : A { + A a; + }; + C c1 = {{}, {}}; // ok, call default ctor twice + C c2 = {{1, 2}, {3, 4}}; // expected-error 2{{no matching constructor}} +} |