summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2011-12-30 03:11:50 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2011-12-30 03:11:50 +0000
commitfafe4b7572fd0884e595a04a34a4fddfed6feccb (patch)
treeab15d3251e781eb9d98f8708adfa29299eb051fe /clang/test/SemaCXX
parent6c08930c5e01e3ef7265a9085a40411543fdf974 (diff)
downloadbcm5719-llvm-fafe4b7572fd0884e595a04a34a4fddfed6feccb.tar.gz
bcm5719-llvm-fafe4b7572fd0884e595a04a34a4fddfed6feccb.zip
Revert r147271. This fixes PR11676.
llvm-svn: 147362
Diffstat (limited to 'clang/test/SemaCXX')
-rw-r--r--clang/test/SemaCXX/constexpr-printing.cpp7
-rw-r--r--clang/test/SemaCXX/constexpr-value-init.cpp31
2 files changed, 2 insertions, 36 deletions
diff --git a/clang/test/SemaCXX/constexpr-printing.cpp b/clang/test/SemaCXX/constexpr-printing.cpp
index cccefca9fa0..e6cf209819a 100644
--- a/clang/test/SemaCXX/constexpr-printing.cpp
+++ b/clang/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/clang/test/SemaCXX/constexpr-value-init.cpp b/clang/test/SemaCXX/constexpr-value-init.cpp
deleted file mode 100644
index efa9e94da12..00000000000
--- a/clang/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, "");
OpenPOWER on IntegriCloud