+2015-01-21 Jason Merrill <jason@redhat.com>
+
+ PR c++/64647
+ * constexpr.c (ensure_literal_type_for_constexpr_object): Don't
+ give a hard error in a template instantiation.
+
2015-01-21 Richard Biener <rguenther@suse.de>
PR middle-end/64313
else if (!literal_type_p (type))
{
if (DECL_DECLARED_CONSTEXPR_P (decl))
- error ("the type %qT of constexpr variable %qD is not literal",
- type, decl);
+ {
+ error ("the type %qT of constexpr variable %qD is not literal",
+ type, decl);
+ explain_non_literal_class (type);
+ }
else
{
- error ("variable %qD of non-literal type %qT in %<constexpr%> "
- "function", decl, type);
+ if (!DECL_TEMPLATE_INSTANTIATION (current_function_decl))
+ {
+ error ("variable %qD of non-literal type %qT in %<constexpr%> "
+ "function", decl, type);
+ explain_non_literal_class (type);
+ }
cp_function_chain->invalid_constexpr = true;
}
- explain_non_literal_class (type);
return NULL;
}
}