diff options
| author | Richard Smith <richard-llvm@metafoo.co.uk> | 2011-06-11 17:19:42 +0000 |
|---|---|---|
| committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2011-06-11 17:19:42 +0000 |
| commit | 938f40b5aa98165826536c67237fc3329d7c1d80 (patch) | |
| tree | 05bea26a37c2198bd5e11e42de38021651c1ef15 /clang/test/CXX/except/except.spec/p14.cpp | |
| parent | 1c2d29e3c30c852c4a541c24e39897e1de267890 (diff) | |
| download | bcm5719-llvm-938f40b5aa98165826536c67237fc3329d7c1d80.tar.gz bcm5719-llvm-938f40b5aa98165826536c67237fc3329d7c1d80.zip | |
Implement support for C++11 in-class initialization of non-static data members.
llvm-svn: 132878
Diffstat (limited to 'clang/test/CXX/except/except.spec/p14.cpp')
| -rw-r--r-- | clang/test/CXX/except/except.spec/p14.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/clang/test/CXX/except/except.spec/p14.cpp b/clang/test/CXX/except/except.spec/p14.cpp index f5e83eaac61..f42fbe907ff 100644 --- a/clang/test/CXX/except/except.spec/p14.cpp +++ b/clang/test/CXX/except/except.spec/p14.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fcxx-exceptions -fexceptions -verify %s +// RUN: %clang_cc1 -fcxx-exceptions -fexceptions -verify -std=c++0x %s struct A { }; struct B { }; struct C { }; @@ -27,3 +27,15 @@ void test_CA() { CA2 &(CA2::*captr3)(const CA2&) throw(A) = &CA2::operator=; // expected-error{{target exception specification is not superset of source}} CA2 &(CA2::*captr4)(const CA2&) throw(B) = &CA2::operator=; // expected-error{{target exception specification is not superset of source}} } + +// In-class member initializers. +struct IC0 { + int inClassInit = 0; +}; +struct IC1 { + int inClassInit = (throw B(), 0); +}; +// FIXME: the exception specification on the default constructor is wrong: +// we cannot currently compute the set of thrown types. +static_assert(noexcept(IC0()), "IC0() does not throw"); +static_assert(!noexcept(IC1()), "IC1() throws"); |

