summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/constexpr-printing.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2011-12-30 21:15:51 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2011-12-30 21:15:51 +0000
commitfddd384b7368b7b22719d5ab848837488810ccbe (patch)
tree175b1b078a16f92cec4c1907dd1025085f2de8eb /clang/test/SemaCXX/constexpr-printing.cpp
parentcd1d447d62fcf8e806585f9e27215eaeeaa097d5 (diff)
downloadbcm5719-llvm-fddd384b7368b7b22719d5ab848837488810ccbe.tar.gz
bcm5719-llvm-fddd384b7368b7b22719d5ab848837488810ccbe.zip
Unrevert r147271, reverted in r147361.
Also temporarily remove the assumption from IR gen that we can emit IR for every constant we can fold, since it isn't currently true in C++11, to fix PR11676. Original comment from r147271: constexpr: perform zero-initialization prior to / instead of performing a constructor call when appropriate. Thanks to Eli for spotting this. llvm-svn: 147384
Diffstat (limited to 'clang/test/SemaCXX/constexpr-printing.cpp')
-rw-r--r--clang/test/SemaCXX/constexpr-printing.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/clang/test/SemaCXX/constexpr-printing.cpp b/clang/test/SemaCXX/constexpr-printing.cpp
index e6cf209819a..cccefca9fa0 100644
--- a/clang/test/SemaCXX/constexpr-printing.cpp
+++ b/clang/test/SemaCXX/constexpr-printing.cpp
@@ -11,8 +11,11 @@ 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; // expected-error {{constant expression}} expected-note {{in call to 'S()'}}
-constexpr S s2(10);
+constexpr S s1; // ok
+void f() {
+ 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;
OpenPOWER on IntegriCloud