diff options
| author | Richard Smith <richard-llvm@metafoo.co.uk> | 2011-12-30 21:15:51 +0000 |
|---|---|---|
| committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2011-12-30 21:15:51 +0000 |
| commit | fddd384b7368b7b22719d5ab848837488810ccbe (patch) | |
| tree | 175b1b078a16f92cec4c1907dd1025085f2de8eb /clang/test/SemaCXX/constexpr-printing.cpp | |
| parent | cd1d447d62fcf8e806585f9e27215eaeeaa097d5 (diff) | |
| download | bcm5719-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.cpp | 7 |
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; |

