+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.
}
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)
struct A
{
int i;
- constexpr A() { } // { dg-error "uninitialized member .A::i" }
+ constexpr A() { } // { dg-error "A::i" }
};
struct B1
{
A1 a1;
- constexpr B1() {} // { dg-error "uninitialized member" }
+ constexpr B1() {} // { dg-error "B1::a1" }
};
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>
template <class T> struct A
{
T t;
- constexpr A() { } // { dg-error "uninitialized" }
+ constexpr A() { } // { dg-error "::t" }
};
int main()
constexpr B b; // { dg-error "B::B" }
-// { dg-prune-output "uninitialized member" }
+// { dg-prune-output "B::a1" }