diff options
Diffstat (limited to 'test/SemaCXX')
-rw-r--r-- | test/SemaCXX/constexpr-printing.cpp | 7 | ||||
-rw-r--r-- | test/SemaCXX/constexpr-value-init.cpp | 31 |
2 files changed, 2 insertions, 36 deletions
diff --git a/test/SemaCXX/constexpr-printing.cpp b/test/SemaCXX/constexpr-printing.cpp index cccefca9fa..e6cf209819 100644 --- a/test/SemaCXX/constexpr-printing.cpp +++ b/test/SemaCXX/constexpr-printing.cpp @@ -11,11 +11,8 @@ struct S { constexpr int extract(const S &s) { return s.n; } // expected-note {{read of uninitialized object is not allowed in a constant expression}} -constexpr S s1; // ok -void f() { - constexpr S s1; // expected-error {{constant expression}} expected-note {{in call to 'S()'}} - constexpr S s2(10); -} +constexpr S s1; // expected-error {{constant expression}} expected-note {{in call to 'S()'}} +constexpr S s2(10); typedef __attribute__((vector_size(16))) int vector_int; diff --git a/test/SemaCXX/constexpr-value-init.cpp b/test/SemaCXX/constexpr-value-init.cpp deleted file mode 100644 index efa9e94da1..0000000000 --- a/test/SemaCXX/constexpr-value-init.cpp +++ /dev/null @@ -1,31 +0,0 @@ -// RUN: %clang_cc1 %s -std=c++11 -fsyntax-only -verify - -struct A { - constexpr A() : a(b + 1), b(a + 1) {} // expected-note {{uninitialized}} - int a; - int b; -}; -struct B { - A a; -}; - -constexpr A a; // ok, zero initialization preceeds static initialization -void f() { - constexpr A a; // expected-error {{constant expression}} expected-note {{in call to 'A()'}} -} - -constexpr B b1; // expected-error {{requires a user-provided default constructor}} -constexpr B b2 = B(); // ok -static_assert(b2.a.a == 1, ""); -static_assert(b2.a.b == 2, ""); - -struct C { - int c; -}; -struct D : C { int d; }; -constexpr C c1; // expected-error {{requires a user-provided default constructor}} -constexpr C c2 = C(); // ok -constexpr D d1; // expected-error {{requires a user-provided default constructor}} -constexpr D d2 = D(); // expected-error {{constant expression}} expected-note {{non-literal type 'const D'}} -static_assert(D().c == 0, ""); -static_assert(D().d == 0, ""); |