if (DECL_DECLARED_CONSTEXPR_P (decl))
{
auto_diagnostic_group d;
- error ("the type %qT of %<constexpr%> variable %qD "
- "is not literal", type, decl);
+ error_at (DECL_SOURCE_LOCATION (decl),
+ "the type %qT of %<constexpr%> variable %qD "
+ "is not literal", type, decl);
explain_non_literal_class (type);
decl = error_mark_node;
}
if (!is_instantiation_of_constexpr (current_function_decl))
{
auto_diagnostic_group d;
- error ("variable %qD of non-literal type %qT in %<constexpr%> "
- "function", decl, type);
+ error_at (DECL_SOURCE_LOCATION (decl),
+ "variable %qD of non-literal type %qT in "
+ "%<constexpr%> function", decl, type);
explain_non_literal_class (type);
decl = error_mark_node;
}
else if (DECL_DECLARED_CONSTEXPR_P (decl)
&& variably_modified_type_p (type, NULL_TREE))
{
- error ("%<constexpr%> variable %qD has variably-modified type %qT",
- decl, type);
+ error_at (DECL_SOURCE_LOCATION (decl),
+ "%<constexpr%> variable %qD has variably-modified "
+ "type %qT", decl, type);
decl = error_mark_node;
}
}
+2018-11-15 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * g++.dg/cpp0x/constexpr-diag3.C: Check locations too.
+ * g++.dg/cpp0x/constexpr-ice19.C: Likewise.
+ * g++.dg/cpp0x/constexpr-nonlit2.C: Likewise.
+ * g++.dg/cpp1z/constexpr-lambda15.C: Likewise.
+ * g++.dg/ext/constexpr-vla5.C: Likewise.
+ * g++.dg/gomp/pr85134.C: Likewise.
+
2018-11-15 Nathan Sidwell <nathan@acm.org>
DR 2336