summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/implicit-exception-spec.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/SemaCXX/implicit-exception-spec.cpp')
-rw-r--r--clang/test/SemaCXX/implicit-exception-spec.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/clang/test/SemaCXX/implicit-exception-spec.cpp b/clang/test/SemaCXX/implicit-exception-spec.cpp
index ff3d685d912..12871b8ce70 100644
--- a/clang/test/SemaCXX/implicit-exception-spec.cpp
+++ b/clang/test/SemaCXX/implicit-exception-spec.cpp
@@ -16,31 +16,31 @@ namespace InClassInitializers {
// Noexcept::Noexcept is not declared constexpr, therefore noexcept(Noexcept())
// is false.
bool ThrowSomething() noexcept(false);
- struct ConstExpr {
- bool b = noexcept(ConstExpr()) && ThrowSomething(); // expected-error {{cannot use defaulted default constructor of 'ConstExpr' within the class outside of member functions}}
+ struct ConstExpr { // expected-error {{default member initializer for 'b' needed}}
+ bool b = noexcept(ConstExpr()) && ThrowSomething(); // expected-note {{declared here}}
// expected-note@-1 {{implicit default constructor for 'InClassInitializers::ConstExpr' first required here}}
};
// Much more obviously broken: we can't parse the initializer without already
// knowing whether it produces a noexcept expression.
- struct TemplateArg {
- int n = ExceptionIf<noexcept(TemplateArg())>::f(); // expected-error {{cannot use defaulted default constructor of 'TemplateArg' within the class outside of member functions}}
+ struct TemplateArg { // expected-error {{default member initializer for 'n' needed}}
+ int n = ExceptionIf<noexcept(TemplateArg())>::f(); // expected-note {{declared here}}
// expected-note@-1 {{implicit default constructor for 'InClassInitializers::TemplateArg' first required here}}
};
// And within a nested class.
struct Nested { // expected-note {{implicit default constructor for 'InClassInitializers::Nested::Inner' first required here}}
- struct Inner {
- // expected-error@+1 {{cannot use defaulted default constructor of 'Inner' within 'Nested' outside of member functions}}
- int n = ExceptionIf<noexcept(Nested())>::f(); // expected-note {{implicit default constructor for 'InClassInitializers::Nested' first required here}}
+ struct Inner { // expected-error {{default member initializer for 'n' needed}}
+ int n = // expected-note {{declared here}}
+ ExceptionIf<noexcept(Nested())>::f(); // expected-note {{implicit default constructor for 'InClassInitializers::Nested' first required here}}
} inner;
};
struct Nested2 { // expected-error {{implicit default constructor for 'InClassInitializers::Nested2' must explicitly initialize the member 'inner' which does not have a default constructor}}
struct Inner;
int n = Inner().n; // expected-note {{implicit default constructor for 'InClassInitializers::Nested2::Inner' first required here}}
- struct Inner { // expected-note {{declared here}}
- // expected-error@+1 {{cannot use defaulted default constructor of 'Inner' within 'Nested2' outside of member functions}}
+ struct Inner { // expected-error {{initializer for 'n' needed}} expected-note {{declared here}}
+ // expected-note@+1 {{declared here}}
int n = ExceptionIf<noexcept(Nested2())>::f();
// expected-note@-1 {{implicit default constructor for 'InClassInitializers::Nested2' first required here}}
} inner; // expected-note {{member is declared here}}
OpenPOWER on IntegriCloud