* constexpr.c (cx_check_missing_mem_inits): Clarify error message.
From-SVN: r217616
This commit is contained in:
parent
f5f0826428
commit
b8cd39962c
@ -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.
|
||||
|
@ -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)
|
||||
|
@ -3,5 +3,5 @@
|
||||
struct A
|
||||
{
|
||||
int i;
|
||||
constexpr A() { } // { dg-error "uninitialized member .A::i" }
|
||||
constexpr A() { } // { dg-error "A::i" }
|
||||
};
|
||||
|
@ -21,5 +21,5 @@ struct A1
|
||||
struct B1
|
||||
{
|
||||
A1 a1;
|
||||
constexpr B1() {} // { dg-error "uninitialized member" }
|
||||
constexpr B1() {} // { dg-error "B1::a1" }
|
||||
};
|
||||
|
@ -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>
|
||||
|
@ -3,7 +3,7 @@
|
||||
template <class T> struct A
|
||||
{
|
||||
T t;
|
||||
constexpr A() { } // { dg-error "uninitialized" }
|
||||
constexpr A() { } // { dg-error "::t" }
|
||||
};
|
||||
|
||||
int main()
|
||||
|
@ -15,4 +15,4 @@ struct B
|
||||
|
||||
constexpr B b; // { dg-error "B::B" }
|
||||
|
||||
// { dg-prune-output "uninitialized member" }
|
||||
// { dg-prune-output "B::a1" }
|
||||
|
Loading…
Reference in New Issue
Block a user