diff options
Diffstat (limited to 'test/SemaCXX/constant-expression-cxx11.cpp')
-rw-r--r-- | test/SemaCXX/constant-expression-cxx11.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/test/SemaCXX/constant-expression-cxx11.cpp b/test/SemaCXX/constant-expression-cxx11.cpp index 995cd2ffec..0993a982d8 100644 --- a/test/SemaCXX/constant-expression-cxx11.cpp +++ b/test/SemaCXX/constant-expression-cxx11.cpp @@ -86,7 +86,7 @@ namespace TemplateArgumentConversion { using IntParam0 = IntParam<0>; using IntParam0 = IntParam<id(0)>; - using IntParam0 = IntParam<MemberZero().zero>; // expected-error {{did you mean to call it with no arguments?}} expected-error {{not an integral constant expression}} + using IntParam0 = IntParam<MemberZero().zero>; // expected-error {{did you mean to call it with no arguments?}} } namespace CaseStatements { @@ -517,16 +517,15 @@ struct D { }; static_assert(D().c.n == 42, ""); -struct E { // expected-note {{here}} +struct E { constexpr E() : p(&p) {} // expected-note {{pointer to temporary cannot be used to initialize a member in a constant expression}} void *p; }; constexpr const E &e1 = E(); // expected-error {{constant expression}} expected-note {{in call to 'E()'}} expected-note {{temporary created here}} // This is a constant expression if we elide the copy constructor call, and // is not a constant expression if we don't! But we do, so it is. -// FIXME: The move constructor is not currently implicitly defined as constexpr. -constexpr E e2 = E(); // unexpected-error {{constant expression}} unexpected-note {{here}} unexpected-note {{non-constexpr constructor 'E' cannot be used in a constant expression}} -static_assert(e2.p == &e2.p, ""); // unexpected-error {{constant expression}} unexpected-note {{initializer of 'e2' is not a constant expression}} +constexpr E e2 = E(); +static_assert(e2.p == &e2.p, ""); constexpr E e3; static_assert(e3.p == &e3.p, ""); |