* constexpr.c (cx_check_missing_mem_inits): Clarify error message.

From-SVN: r217616
This commit is contained in:
Jason Merrill 2014-11-15 18:28:46 -05:00 committed by Jason Merrill
parent f5f0826428
commit b8cd39962c
7 changed files with 12 additions and 7 deletions

View File

@ -1,3 +1,7 @@
2014-11-15 Jason Merrill <jason@redhat.com>
* constexpr.c (cx_check_missing_mem_inits): Clarify error message.
2014-11-14 Paolo Carlini <paolo.carlini@oracle.com>
* semantics.c (end_maybe_infinite_loop): Use fold_non_dependent_expr.

View File

@ -716,8 +716,9 @@ cx_check_missing_mem_inits (tree fun, tree body, bool complain)
}
if (!complain)
return true;
error ("uninitialized member %qD in %<constexpr%> constructor",
field);
error ("member %qD must be initialized by mem-initializer "
"in %<constexpr%> constructor", field);
inform (DECL_SOURCE_LOCATION (field), "declared here");
bad = true;
}
if (field == NULL_TREE)

View File

@ -3,5 +3,5 @@
struct A
{
int i;
constexpr A() { } // { dg-error "uninitialized member .A::i" }
constexpr A() { } // { dg-error "A::i" }
};

View File

@ -21,5 +21,5 @@ struct A1
struct B1
{
A1 a1;
constexpr B1() {} // { dg-error "uninitialized member" }
constexpr B1() {} // { dg-error "B1::a1" }
};

View File

@ -6,7 +6,7 @@
struct A
{
int i;
constexpr A(int _i) { i = _i; } // { dg-error "empty body|uninitialized member" }
constexpr A(int _i) { i = _i; } // { dg-error "empty body|A::i" }
};
template <class T>

View File

@ -3,7 +3,7 @@
template <class T> struct A
{
T t;
constexpr A() { } // { dg-error "uninitialized" }
constexpr A() { } // { dg-error "::t" }
};
int main()

View File

@ -15,4 +15,4 @@ struct B
constexpr B b; // { dg-error "B::B" }
// { dg-prune-output "uninitialized member" }
// { dg-prune-output "B::a1" }