aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2017-11-21 19:58:49 +0100
committerMartin Liska <marxin@gcc.gnu.org>2017-11-21 18:58:49 +0000
commit84fa214dea091e289950a41b70964de73a3c1172 (patch)
treef8fd9613d4d6845a439630a400e2ba440a186d11 /gcc
parentfc3605f174962ccf6bfd537065c304d0c4270663 (diff)
downloadgcc-84fa214dea091e289950a41b70964de73a3c1172.zip
gcc-84fa214dea091e289950a41b70964de73a3c1172.tar.gz
gcc-84fa214dea091e289950a41b70964de73a3c1172.tar.bz2
Add quotes for constexpr keyword.
2017-11-21 Martin Liska <mliska@suse.cz> * class.c (finalize_literal_type_property): Add quotes for constexpr keyword. (explain_non_literal_class): Likewise. * constexpr.c (ensure_literal_type_for_constexpr_object): Likewise. (is_valid_constexpr_fn): Likewise. (check_constexpr_ctor_body): Likewise. (register_constexpr_fundef): Likewise. (explain_invalid_constexpr_fn): Likewise. (cxx_eval_builtin_function_call): Likewise. (cxx_eval_call_expression): Likewise. (cxx_eval_loop_expr): Likewise. (potential_constant_expression_1): Likewise. * decl.c (check_previous_goto_1): Likewise. (check_goto): Likewise. (grokfndecl): Likewise. (grokdeclarator): Likewise. * error.c (maybe_print_constexpr_context): Likewise. * method.c (process_subob_fn): Likewise. (defaulted_late_check): Likewise. * parser.c (cp_parser_compound_statement): Likewise. 2017-11-21 Martin Liska <mliska@suse.cz> * g++.dg/cpp0x/constexpr-48089.C: Add quotes for constexpr keyword; add dg-message for 'in .constexpr. expansion of '. * g++.dg/cpp0x/constexpr-50060.C: Likewise. * g++.dg/cpp0x/constexpr-60049.C: Likewise. * g++.dg/cpp0x/constexpr-70323.C: Likewise. * g++.dg/cpp0x/constexpr-70323a.C: Likewise. * g++.dg/cpp0x/constexpr-cast.C: Likewise. * g++.dg/cpp0x/constexpr-diag3.C: Likewise. * g++.dg/cpp0x/constexpr-ex1.C: Likewise. * g++.dg/cpp0x/constexpr-generated1.C: Likewise. * g++.dg/cpp0x/constexpr-ice16.C: Likewise. * g++.dg/cpp0x/constexpr-ice5.C: Likewise. * g++.dg/cpp0x/constexpr-incomplete2.C: Likewise. * g++.dg/cpp0x/constexpr-neg1.C: Likewise. * g++.dg/cpp0x/constexpr-recursion.C: Likewise. * g++.dg/cpp0x/constexpr-shift1.C: Likewise. * g++.dg/cpp1y/constexpr-70265-1.C: Likewise. * g++.dg/cpp1y/constexpr-70265-2.C: Likewise. * g++.dg/cpp1y/constexpr-79655.C: Likewise. * g++.dg/cpp1y/constexpr-new.C: Likewise. * g++.dg/cpp1y/constexpr-return2.C: Likewise. * g++.dg/cpp1y/constexpr-shift1.C: Likewise. * g++.dg/cpp1y/constexpr-throw.C: Likewise. * g++.dg/cpp1z/constexpr-lambda6.C: Likewise. * g++.dg/ext/constexpr-vla1.C: Likewise. * g++.dg/ext/constexpr-vla2.C: Likewise. * g++.dg/ext/constexpr-vla3.C: Likewise. * g++.dg/cpp0x/static_assert10.C: Likewise. * g++.dg/cpp1y/pr63996.C: Likewise. * g++.dg/cpp1y/pr68180.C: Likewise. * g++.dg/cpp1y/pr77830.C: Likewise. * g++.dg/ubsan/pr63956.C: Likewise. From-SVN: r255025
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog23
-rw-r--r--gcc/cp/class.c4
-rw-r--r--gcc/cp/constexpr.c35
-rw-r--r--gcc/cp/decl.c10
-rw-r--r--gcc/cp/error.c4
-rw-r--r--gcc/cp/method.c6
-rw-r--r--gcc/cp/parser.c2
-rw-r--r--gcc/testsuite/ChangeLog35
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-48089.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-50060.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-60049.C10
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-70323.C4
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-70323a.C4
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-cast.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-diag3.C10
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-ex1.C6
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-generated1.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-ice16.C4
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-ice5.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-incomplete2.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-neg1.C6
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-recursion.C4
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-shift1.C14
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/static_assert10.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp1y/constexpr-70265-1.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp1y/constexpr-70265-2.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp1y/constexpr-79655.C8
-rw-r--r--gcc/testsuite/g++.dg/cpp1y/constexpr-new.C4
-rw-r--r--gcc/testsuite/g++.dg/cpp1y/constexpr-return2.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp1y/constexpr-shift1.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp1y/constexpr-throw.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp1y/pr63996.C3
-rw-r--r--gcc/testsuite/g++.dg/cpp1y/pr68180.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp1y/pr77830.C4
-rw-r--r--gcc/testsuite/g++.dg/cpp1z/constexpr-lambda6.C2
-rw-r--r--gcc/testsuite/g++.dg/ext/constexpr-vla1.C2
-rw-r--r--gcc/testsuite/g++.dg/ext/constexpr-vla2.C4
-rw-r--r--gcc/testsuite/g++.dg/ext/constexpr-vla3.C2
-rw-r--r--gcc/testsuite/g++.dg/ubsan/pr63956.C38
39 files changed, 166 insertions, 108 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 8a6328a..42252bf 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,26 @@
+2017-11-21 Martin Liska <mliska@suse.cz>
+
+ * class.c (finalize_literal_type_property): Add quotes for
+ constexpr keyword.
+ (explain_non_literal_class): Likewise.
+ * constexpr.c (ensure_literal_type_for_constexpr_object): Likewise.
+ (is_valid_constexpr_fn): Likewise.
+ (check_constexpr_ctor_body): Likewise.
+ (register_constexpr_fundef): Likewise.
+ (explain_invalid_constexpr_fn): Likewise.
+ (cxx_eval_builtin_function_call): Likewise.
+ (cxx_eval_call_expression): Likewise.
+ (cxx_eval_loop_expr): Likewise.
+ (potential_constant_expression_1): Likewise.
+ * decl.c (check_previous_goto_1): Likewise.
+ (check_goto): Likewise.
+ (grokfndecl): Likewise.
+ (grokdeclarator): Likewise.
+ * error.c (maybe_print_constexpr_context): Likewise.
+ * method.c (process_subob_fn): Likewise.
+ (defaulted_late_check): Likewise.
+ * parser.c (cp_parser_compound_statement): Likewise.
+
2017-11-21 Marc Glisse <marc.glisse@inria.fr>
* constexpr.c (cxx_eval_constant_expression,
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index 586a32c..529f37f 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -5368,7 +5368,7 @@ finalize_literal_type_property (tree t)
DECL_DECLARED_CONSTEXPR_P (fn) = false;
if (!DECL_GENERATED_P (fn)
&& pedwarn (DECL_SOURCE_LOCATION (fn), OPT_Wpedantic,
- "enclosing class of constexpr non-static member "
+ "enclosing class of %<constexpr%> non-static member "
"function %q+#D is not a literal type", fn))
explain_non_literal_class (t);
}
@@ -5406,7 +5406,7 @@ explain_non_literal_class (tree t)
{
inform (UNKNOWN_LOCATION,
" %q+T is not an aggregate, does not have a trivial "
- "default constructor, and has no constexpr constructor that "
+ "default constructor, and has no %<constexpr%> constructor that "
"is not a copy or move constructor", t);
if (type_has_non_user_provided_default_constructor (t))
/* Note that we can't simply call locate_ctor because when the
diff --git a/gcc/cp/constexpr.c b/gcc/cp/constexpr.c
index 34a9c6b..92f5191 100644
--- a/gcc/cp/constexpr.c
+++ b/gcc/cp/constexpr.c
@@ -94,8 +94,8 @@ ensure_literal_type_for_constexpr_object (tree decl)
{
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
@@ -177,7 +177,7 @@ is_valid_constexpr_fn (tree fun, bool complain)
{
ret = false;
if (complain)
- error ("inherited constructor %qD is not constexpr",
+ error ("inherited constructor %qD is not %<constexpr%>",
DECL_INHERITED_CTOR (fun));
}
else
@@ -189,7 +189,7 @@ is_valid_constexpr_fn (tree fun, bool complain)
ret = false;
if (complain)
{
- error ("invalid type for parameter %d of constexpr "
+ error ("invalid type for parameter %d of %<constexpr%> "
"function %q+#D", DECL_PARM_INDEX (parm), fun);
explain_non_literal_class (TREE_TYPE (parm));
}
@@ -201,7 +201,7 @@ is_valid_constexpr_fn (tree fun, bool complain)
ret = false;
if (complain)
inform (DECL_SOURCE_LOCATION (fun),
- "lambdas are implicitly constexpr only in C++17 and later");
+ "lambdas are implicitly %<constexpr%> only in C++17 and later");
}
else if (!DECL_CONSTRUCTOR_P (fun))
{
@@ -211,7 +211,7 @@ is_valid_constexpr_fn (tree fun, bool complain)
ret = false;
if (complain)
{
- error ("invalid return type %qT of constexpr function %q+D",
+ error ("invalid return type %qT of %<constexpr%> function %q+D",
rettype, fun);
explain_non_literal_class (rettype);
}
@@ -225,7 +225,7 @@ is_valid_constexpr_fn (tree fun, bool complain)
ret = false;
if (complain
&& pedwarn (DECL_SOURCE_LOCATION (fun), OPT_Wpedantic,
- "enclosing class of constexpr non-static member "
+ "enclosing class of %<constexpr%> non-static member "
"function %q+#D is not a literal type", fun))
explain_non_literal_class (DECL_CONTEXT (fun));
}
@@ -494,7 +494,7 @@ check_constexpr_ctor_body (tree last, tree list, bool complain)
if (!ok)
{
if (complain)
- error ("constexpr constructor does not have empty body");
+ error ("%<constexpr%> constructor does not have empty body");
DECL_DECLARED_CONSTEXPR_P (current_function_decl) = false;
}
return ok;
@@ -845,7 +845,8 @@ register_constexpr_fundef (tree fun, tree body)
if (massaged == NULL_TREE || massaged == error_mark_node)
{
if (!DECL_CONSTRUCTOR_P (fun))
- error ("body of constexpr function %qD not a return-statement", fun);
+ error ("body of %<constexpr%> function %qD not a return-statement",
+ fun);
return NULL;
}
@@ -905,7 +906,7 @@ explain_invalid_constexpr_fn (tree fun)
input_location set to our caller's location. */
input_location = DECL_SOURCE_LOCATION (fun);
inform (input_location,
- "%qD is not usable as a constexpr function because:", fun);
+ "%qD is not usable as a %<constexpr%> function because:", fun);
}
/* First check the declaration. */
if (is_valid_constexpr_fn (fun, true))
@@ -1194,7 +1195,7 @@ cxx_eval_builtin_function_call (const constexpr_ctx *ctx, tree t, tree fun,
comes from cp_maybe_instrument_return. */
if (DECL_FUNCTION_CODE (fun) == BUILT_IN_UNREACHABLE
&& EXPR_LOCATION (t) == BUILTINS_LOCATION)
- error ("constexpr call flows off the end of the function");
+ error ("%<constexpr%> call flows off the end of the function");
else
{
new_call = build_call_array_loc (EXPR_LOCATION (t), TREE_TYPE (t),
@@ -1465,7 +1466,7 @@ cxx_eval_call_expression (const constexpr_ctx *ctx, tree t,
if (TREE_CODE (fun) != FUNCTION_DECL)
{
if (!ctx->quiet && !*non_constant_p)
- error_at (loc, "expression %qE does not designate a constexpr "
+ error_at (loc, "expression %qE does not designate a %<constexpr%> "
"function", fun);
*non_constant_p = true;
return t;
@@ -1484,7 +1485,7 @@ cxx_eval_call_expression (const constexpr_ctx *ctx, tree t,
if (!ctx->quiet)
{
if (!lambda_static_thunk_p (fun))
- error_at (loc, "call to non-constexpr function %qD", fun);
+ error_at (loc, "call to non-%<constexpr%> function %qD", fun);
explain_invalid_constexpr_fn (fun);
}
*non_constant_p = true;
@@ -1618,7 +1619,7 @@ cxx_eval_call_expression (const constexpr_ctx *ctx, tree t,
if (!depth_ok)
{
if (!ctx->quiet)
- error ("constexpr evaluation depth exceeds maximum of %d (use "
+ error ("%<constexpr%> evaluation depth exceeds maximum of %d (use "
"-fconstexpr-depth= to increase the maximum)",
max_constexpr_depth);
*non_constant_p = true;
@@ -1701,7 +1702,7 @@ cxx_eval_call_expression (const constexpr_ctx *ctx, tree t,
if (result == NULL_TREE && !*non_constant_p)
{
if (!ctx->quiet)
- error ("constexpr call flows off the end "
+ error ("%<constexpr%> call flows off the end "
"of the function");
*non_constant_p = true;
}
@@ -3886,7 +3887,7 @@ cxx_eval_loop_expr (const constexpr_ctx *ctx, tree t,
{
if (!ctx->quiet)
error_at (EXPR_LOC_OR_LOC (t, input_location),
- "constexpr loop iteration count exceeds limit of %d "
+ "%<constexpr%> loop iteration count exceeds limit of %d "
"(use -fconstexpr-loop-limit= to increase the limit)",
constexpr_loop_limit);
*non_constant_p = true;
@@ -5256,7 +5257,7 @@ potential_constant_expression_1 (tree t, bool want_rval, bool strict, bool now,
{
if (flags & tf_error)
{
- error_at (loc, "call to non-constexpr function %qD",
+ error_at (loc, "call to non-%<constexpr%> function %qD",
fun);
explain_invalid_constexpr_fn (fun);
}
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 54e0656..a7cb615 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -3315,7 +3315,7 @@ check_goto (tree decl)
else if (ent->in_transaction_scope)
inform (input_location, " enters synchronized or atomic statement");
else if (ent->in_constexpr_if)
- inform (input_location, " enters constexpr if statement");
+ inform (input_location, " enters %<constexpr%> if statement");
}
if (ent->in_omp_scope)
@@ -8606,7 +8606,7 @@ grokfndecl (tree ctype,
if (inlinep & 1)
error ("cannot declare %<::main%> to be inline");
if (inlinep & 2)
- error ("cannot declare %<::main%> to be constexpr");
+ error ("cannot declare %<::main%> to be %<constexpr%>");
if (!publicp)
error ("cannot declare %<::main%> to be static");
inlinep = 0;
@@ -12050,7 +12050,7 @@ grokdeclarator (const cp_declarator *declarator,
unqualified_id);
else if (constexpr_p && !initialized)
{
- error ("constexpr static data member %qD must have an "
+ error ("%<constexpr%> static data member %qD must have an "
"initializer", decl);
constexpr_p = false;
}
@@ -12278,8 +12278,8 @@ grokdeclarator (const cp_declarator *declarator,
}
else if (constexpr_p && DECL_EXTERNAL (decl))
{
- error ("declaration of constexpr variable %qD is not a definition",
- decl);
+ error ("declaration of %<constexpr%> variable %qD "
+ "is not a definition", decl);
constexpr_p = false;
}
diff --git a/gcc/cp/error.c b/gcc/cp/error.c
index 7125b88..6d1f3da 100644
--- a/gcc/cp/error.c
+++ b/gcc/cp/error.c
@@ -3588,11 +3588,11 @@ maybe_print_constexpr_context (diagnostic_context *context)
const char *s = expr_as_string (t, 0);
if (context->show_column)
pp_verbatim (context->printer,
- _("%r%s:%d:%d:%R in constexpr expansion of %qs"),
+ _("%r%s:%d:%d:%R in %<constexpr%> expansion of %qs"),
"locus", xloc.file, xloc.line, xloc.column, s);
else
pp_verbatim (context->printer,
- _("%r%s:%d:%R in constexpr expansion of %qs"),
+ _("%r%s:%d:%R in %<constexpr%> expansion of %qs"),
"locus", xloc.file, xloc.line, s);
pp_newline (context->printer);
}
diff --git a/gcc/cp/method.c b/gcc/cp/method.c
index 714b508..534aaa3 100644
--- a/gcc/cp/method.c
+++ b/gcc/cp/method.c
@@ -1293,7 +1293,7 @@ process_subob_fn (tree fn, tree *spec_p, bool *trivial_p,
if (diag)
{
inform (DECL_SOURCE_LOCATION (fn),
- "defaulted constructor calls non-constexpr %qD", fn);
+ "defaulted constructor calls non-%<constexpr%> %qD", fn);
explain_invalid_constexpr_fn (fn);
}
}
@@ -2257,8 +2257,8 @@ defaulted_late_check (tree fn)
if (!CLASSTYPE_TEMPLATE_INSTANTIATION (ctx))
{
error ("explicitly defaulted function %q+D cannot be declared "
- "as constexpr because the implicit declaration is not "
- "constexpr:", fn);
+ "as %<constexpr%> because the implicit declaration is not "
+ "%<constexpr%>:", fn);
explain_implicit_non_constexpr (fn);
}
DECL_DECLARED_CONSTEXPR_P (fn) = false;
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index b061704..1ad351c 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -11295,7 +11295,7 @@ cp_parser_compound_statement (cp_parser *parser, tree in_statement_expr,
if (DECL_DECLARED_CONSTEXPR_P (current_function_decl)
&& !function_body && cxx_dialect < cxx14)
pedwarn (input_location, OPT_Wpedantic,
- "compound-statement in constexpr function");
+ "compound-statement in %<constexpr%> function");
/* Begin the compound-statement. */
compound_stmt = begin_compound_stmt (bcs_flags);
/* If the next keyword is `__label__' we have a label declaration. */
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index eb333c1..4228250 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,38 @@
+2017-11-21 Martin Liska <mliska@suse.cz>
+
+ * g++.dg/cpp0x/constexpr-48089.C: Add quotes for constexpr
+ keyword; add dg-message for 'in .constexpr. expansion of '.
+ * g++.dg/cpp0x/constexpr-50060.C: Likewise.
+ * g++.dg/cpp0x/constexpr-60049.C: Likewise.
+ * g++.dg/cpp0x/constexpr-70323.C: Likewise.
+ * g++.dg/cpp0x/constexpr-70323a.C: Likewise.
+ * g++.dg/cpp0x/constexpr-cast.C: Likewise.
+ * g++.dg/cpp0x/constexpr-diag3.C: Likewise.
+ * g++.dg/cpp0x/constexpr-ex1.C: Likewise.
+ * g++.dg/cpp0x/constexpr-generated1.C: Likewise.
+ * g++.dg/cpp0x/constexpr-ice16.C: Likewise.
+ * g++.dg/cpp0x/constexpr-ice5.C: Likewise.
+ * g++.dg/cpp0x/constexpr-incomplete2.C: Likewise.
+ * g++.dg/cpp0x/constexpr-neg1.C: Likewise.
+ * g++.dg/cpp0x/constexpr-recursion.C: Likewise.
+ * g++.dg/cpp0x/constexpr-shift1.C: Likewise.
+ * g++.dg/cpp1y/constexpr-70265-1.C: Likewise.
+ * g++.dg/cpp1y/constexpr-70265-2.C: Likewise.
+ * g++.dg/cpp1y/constexpr-79655.C: Likewise.
+ * g++.dg/cpp1y/constexpr-new.C: Likewise.
+ * g++.dg/cpp1y/constexpr-return2.C: Likewise.
+ * g++.dg/cpp1y/constexpr-shift1.C: Likewise.
+ * g++.dg/cpp1y/constexpr-throw.C: Likewise.
+ * g++.dg/cpp1z/constexpr-lambda6.C: Likewise.
+ * g++.dg/ext/constexpr-vla1.C: Likewise.
+ * g++.dg/ext/constexpr-vla2.C: Likewise.
+ * g++.dg/ext/constexpr-vla3.C: Likewise.
+ * g++.dg/cpp0x/static_assert10.C: Likewise.
+ * g++.dg/cpp1y/pr63996.C: Likewise.
+ * g++.dg/cpp1y/pr68180.C: Likewise.
+ * g++.dg/cpp1y/pr77830.C: Likewise.
+ * g++.dg/ubsan/pr63956.C: Likewise.
+
2017-11-21 Jakub Jelinek <jakub@redhat.com>
PR c++/83045
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-48089.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-48089.C
index 31010ed..4574eb8 100644
--- a/gcc/testsuite/g++.dg/cpp0x/constexpr-48089.C
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-48089.C
@@ -14,7 +14,7 @@ struct s {
int v;
};
-constexpr s bang; // { dg-error "" }
+constexpr s bang; // { dg-error "|" }
struct R {
int i,j;
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-50060.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-50060.C
index d2df08e..d991428 100644
--- a/gcc/testsuite/g++.dg/cpp0x/constexpr-50060.C
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-50060.C
@@ -17,5 +17,5 @@ struct T
int y;
};
-static_assert (S (6.5).x == 0.8125, ""); // { dg-error "non-constant condition for static assertion|in constexpr expansion" "" { target { ! c++14 } } }
+static_assert (S (6.5).x == 0.8125, ""); // { dg-error "non-constant condition for static assertion|in .constexpr. expansion" "" { target { ! c++14 } } }
static_assert (T (6.5).x == 0.8125, ""); // { dg-error "non-constant condition for static assertion|called in a constant expression" "" { target { ! c++14 } } }
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-60049.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-60049.C
index 3a1ee81..172963f 100644
--- a/gcc/testsuite/g++.dg/cpp0x/constexpr-60049.C
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-60049.C
@@ -11,11 +11,11 @@ constexpr int f5 (int n) { return 1 >> n; } // { dg-error "shift expression" }
constexpr int X = __CHAR_BIT__ * sizeof (int) + 1;
-constexpr int x1 = f1 (X);
-constexpr int x2 = f2 (-1);
-constexpr int x3 = f3 (-1);
-constexpr int x4 = f4 (X);
-constexpr int x5 = f5 (-1);
+constexpr int x1 = f1 (X); // { dg-message "in .constexpr. expansion of" }
+constexpr int x2 = f2 (-1); // { dg-message "in .constexpr. expansion of" }
+constexpr int x3 = f3 (-1); // { dg-message "in .constexpr. expansion of" }
+constexpr int x4 = f4 (X); // { dg-message "in .constexpr. expansion of" }
+constexpr int x5 = f5 (-1); // { dg-message "in .constexpr. expansion of" }
constexpr int y1 = 1 << X; // { dg-error "shift expression" }
constexpr int y2 = 1 << -1; // { dg-error "shift expression" }
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-70323.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-70323.C
index 8307ac8..272a225 100644
--- a/gcc/testsuite/g++.dg/cpp0x/constexpr-70323.C
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-70323.C
@@ -4,7 +4,7 @@
constexpr int overflow_if_0 (int i) { return __INT_MAX__ + !i; }
constexpr int overflow_if_1 (int i) { return __INT_MAX__ + i; }
-constexpr bool i0_0 = overflow_if_0 (0); // { dg-error "overflow in constant expression" }
+constexpr bool i0_0 = overflow_if_0 (0); // { dg-error "overflow in constant expression|in .constexpr. expansion of " }
constexpr bool i0_1 = overflow_if_0 (1);
constexpr bool i1_0 = overflow_if_1 (0);
-constexpr bool i1_1 = overflow_if_1 (1); // { dg-error "overflow in constant expression" }
+constexpr bool i1_1 = overflow_if_1 (1); // { dg-error "overflow in constant expression|in .constexpr. expansion of " }
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-70323a.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-70323a.C
index d166787..1990ab6 100644
--- a/gcc/testsuite/g++.dg/cpp0x/constexpr-70323a.C
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-70323a.C
@@ -5,7 +5,7 @@
constexpr int overflow_if_0 (int i) { return __INT_MAX__ + !i; }
constexpr int overflow_if_1 (int i) { return __INT_MAX__ + i; }
-constexpr bool i0_0 = overflow_if_0 (0); // { dg-error "overflow in constant expression" }
+constexpr bool i0_0 = overflow_if_0 (0); // { dg-error "overflow in constant expression|in .constexpr. expansion of" }
constexpr bool i0_1 = overflow_if_0 (1);
constexpr bool i1_0 = overflow_if_1 (0);
-constexpr bool i1_1 = overflow_if_1 (1); // { dg-error "overflow in constant expression" }
+constexpr bool i1_1 = overflow_if_1 (1); // { dg-error "overflow in constant expression|in .constexpr. expansion of" }
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-cast.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-cast.C
index e23d0d4..1ed01c8 100644
--- a/gcc/testsuite/g++.dg/cpp0x/constexpr-cast.C
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-cast.C
@@ -21,4 +21,4 @@ constexpr bool f ()
#endif
}
-constexpr bool b = f<int>(); // { dg-error "not a constant expression" }
+constexpr bool b = f<int>(); // { dg-error "not a constant expression|in .constexpr. expansion of " }
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-diag3.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-diag3.C
index 27aad93..fc5a721 100644
--- a/gcc/testsuite/g++.dg/cpp0x/constexpr-diag3.C
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-diag3.C
@@ -13,7 +13,7 @@ int main()
// --------------------
-struct complex // { dg-message "no constexpr constructor" }
+struct complex // { dg-message "no .constexpr. constructor" }
{
complex(double r, double i) : re(r), im(i) { }
constexpr double real() const { return re; } // { dg-error "not a literal type" "" { target c++11_only } }
@@ -25,11 +25,11 @@ private:
};
constexpr complex co1(0, 1); // { dg-error "not literal" }
-constexpr double dd2 = co1.real(); // { dg-error "" }
+constexpr double dd2 = co1.real(); // { dg-error "|in .constexpr. expansion of " }
// --------------------
-struct base // { dg-message "no constexpr constructor" }
+struct base // { dg-message "no .constexpr. constructor" }
{
int _M_i;
base() : _M_i(5) { }
@@ -37,7 +37,7 @@ struct base // { dg-message "no constexpr constructor" }
struct derived : public base // { dg-message "base class" }
{
- constexpr derived(): base() { } // { dg-error "non-constexpr function" }
+ constexpr derived(): base() { } // { dg-error "non-.constexpr. function" }
};
constexpr derived obj; // { dg-error "not literal" }
@@ -48,7 +48,7 @@ struct Def
{
int _M_i; // { dg-message "does not initialize" }
- constexpr Def() = default; // { dg-error "implicit declaration is not constexpr" }
+ constexpr Def() = default; // { dg-error "implicit declaration is not .constexpr." }
};
constexpr Def defobj; // { dg-error "uninitialized" }
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-ex1.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-ex1.C
index c4c052a..e5e58bd 100644
--- a/gcc/testsuite/g++.dg/cpp0x/constexpr-ex1.C
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-ex1.C
@@ -54,7 +54,7 @@ constexpr complex I(0, 1); // OK -- literal complex
// 2 invoked with non-const args
-double x5 = 1.0; // { dg-message "not declared .constexpr" }
+double x5 = 1.0; // { dg-message "not declared .constexpr." }
constexpr complex unit(x5, 0); // { dg-error "x5|argument" } error: x5 non-constant
const complex one(x5, 0); // OK, ‘‘ordinary const’’ -- dynamic
// initialization
@@ -87,7 +87,7 @@ struct resource {
}
};
constexpr resource f(resource d)
-{ return d; } // { dg-error "non-constexpr" }
-constexpr resource d = f(9); // { dg-message "constexpr" }
+{ return d; } // { dg-error "non-.constexpr." }
+constexpr resource d = f(9); // { dg-message ".constexpr." }
// 4.4 floating-point constant expressions
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-generated1.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-generated1.C
index 39be3ed..4b0d68b 100644
--- a/gcc/testsuite/g++.dg/cpp0x/constexpr-generated1.C
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-generated1.C
@@ -9,7 +9,7 @@ int g();
// We should complain about this.
template<> constexpr int A<int>::f()
-{ return g(); } // { dg-error "non-constexpr" }
+{ return g(); } // { dg-error "non-.constexpr." }
// But not about this.
struct B
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-ice16.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-ice16.C
index 42b9226..112415b 100644
--- a/gcc/testsuite/g++.dg/cpp0x/constexpr-ice16.C
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-ice16.C
@@ -6,9 +6,9 @@
struct Foo {
constexpr Foo(const unsigned i) : val(i) {}
constexpr Foo operator-(const Foo &rhs) const {
- return assert(val >= rhs.val), Foo(val - rhs.val); // { dg-error "call to non-constexpr" }
+ return assert(val >= rhs.val), Foo(val - rhs.val); // { dg-error "call to non-.constexpr." }
}
unsigned val;
};
-constexpr Foo foo(Foo(1) - Foo(2));
+constexpr Foo foo(Foo(1) - Foo(2)); // { dg-message "in .constexpr. expansion of " }
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-ice5.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-ice5.C
index c5a117c..51b328e 100644
--- a/gcc/testsuite/g++.dg/cpp0x/constexpr-ice5.C
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-ice5.C
@@ -9,5 +9,5 @@ struct A
struct B
{
A a[1];
- constexpr B() : a() {} // { dg-error "non-constant|non-constexpr" }
+ constexpr B() : a() {} // { dg-error "non-constant|non-.constexpr." }
};
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-incomplete2.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-incomplete2.C
index a8af2e6..a04f1d5 100644
--- a/gcc/testsuite/g++.dg/cpp0x/constexpr-incomplete2.C
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-incomplete2.C
@@ -28,4 +28,4 @@ struct D
C<D> c;
};
-constexpr D d {}; // { dg-error "non-constexpr function" }
+constexpr D d {}; // { dg-error "non-.constexpr. function" }
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-neg1.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-neg1.C
index 9c832b1..3366992 100644
--- a/gcc/testsuite/g++.dg/cpp0x/constexpr-neg1.C
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-neg1.C
@@ -5,7 +5,7 @@
constexpr int square(int x); // { dg-message "never defined" }
// error: pixel is a type
-constexpr struct pixel { // { dg-error "constexpr" }
+constexpr struct pixel { // { dg-error ".constexpr." }
int x;
int y;
// OK: declaration
@@ -18,7 +18,7 @@ constexpr pixel::pixel(int a)
// error: square not defined, so small(2) not constant (5.19), so constexpr
// not satisfied
-constexpr pixel small(2); // { dg-message "in constexpr expansion" }
+constexpr pixel small(2); // { dg-message "in .constexpr. expansion of " }
// error: not for parameters
int next(constexpr int x) { // { dg-error "parameter" }
@@ -40,7 +40,7 @@ constexpr int g(int x, int n) {
int r = 1;
while (--n > 0) r *= x;
return r;
-} // { dg-error "body of constexpr function" "" { target c++11_only } }
+} // { dg-error "body of .constexpr. function" "" { target c++11_only } }
class debug_flag {
public:
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-recursion.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-recursion.C
index e3e13f7..8c4201e 100644
--- a/gcc/testsuite/g++.dg/cpp0x/constexpr-recursion.C
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-recursion.C
@@ -2,5 +2,5 @@
// { dg-do compile { target c++11 } }
// { dg-options "-fconstexpr-depth=5" }
// { dg-prune-output "in constexpr expansion" }
-constexpr int f (int i) { return f (i-1); }
-constexpr int i = f(42); // { dg-error "constexpr evaluation depth" }
+constexpr int f (int i) { return f (i-1); } // { dg-message "in .constexpr. expansion of " }
+constexpr int i = f(42); // { dg-error ".constexpr. evaluation depth|in .constexpr. expansion of " }
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-shift1.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-shift1.C
index 1f4ee73..4abd9e0 100644
--- a/gcc/testsuite/g++.dg/cpp0x/constexpr-shift1.C
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-shift1.C
@@ -6,7 +6,7 @@ fn1 (int i, int j)
return i << j; // { dg-error "is negative" }
}
-constexpr int i1 = fn1 (1, -1);
+constexpr int i1 = fn1 (1, -1); // { dg-message "in .constexpr. expansion of " }
constexpr int
fn2 (int i, int j)
@@ -14,7 +14,7 @@ fn2 (int i, int j)
return i << j; // { dg-error "is >= than the precision of the left operand" }
}
-constexpr int i2 = fn2 (1, 200);
+constexpr int i2 = fn2 (1, 200); // { dg-message "in .constexpr. expansion of " }
constexpr int
fn3 (int i, int j)
@@ -22,7 +22,7 @@ fn3 (int i, int j)
return i << j; // { dg-error "is negative" }
}
-constexpr int i3 = fn3 (-1, 2);
+constexpr int i3 = fn3 (-1, 2); // { dg-message "in .constexpr. expansion of " }
constexpr int
fn4 (int i, int j)
@@ -30,7 +30,7 @@ fn4 (int i, int j)
return i << j; // { dg-error "overflows" }
}
-constexpr int i4 = fn4 (__INT_MAX__, 2);
+constexpr int i4 = fn4 (__INT_MAX__, 2); // { dg-message "in .constexpr. expansion of " }
constexpr int
fn5 (int i, int j)
@@ -46,7 +46,7 @@ fn6 (unsigned int i, unsigned int j)
return i << j; // { dg-error "is >= than the precision of the left operand" }
}
-constexpr int i6 = fn6 (1, -1);
+constexpr int i6 = fn6 (1, -1); // { dg-message "in .constexpr. expansion of " }
constexpr int
fn7 (int i, int j)
@@ -54,7 +54,7 @@ fn7 (int i, int j)
return i >> j; // { dg-error "is negative" }
}
-constexpr int i7 = fn7 (1, -1);
+constexpr int i7 = fn7 (1, -1); // { dg-message "in .constexpr. expansion of " }
constexpr int
fn8 (int i, int j)
@@ -70,4 +70,4 @@ fn9 (int i, int j)
return i >> j; // { dg-error "is >= than the precision of the left operand" }
}
-constexpr int i9 = fn9 (1, 200);
+constexpr int i9 = fn9 (1, 200); // { dg-message "in .constexpr. expansion of " }
diff --git a/gcc/testsuite/g++.dg/cpp0x/static_assert10.C b/gcc/testsuite/g++.dg/cpp0x/static_assert10.C
index ffbf3c0..5ff0854 100644
--- a/gcc/testsuite/g++.dg/cpp0x/static_assert10.C
+++ b/gcc/testsuite/g++.dg/cpp0x/static_assert10.C
@@ -4,6 +4,6 @@
template<typename T> bool foo(T)
{
int i;
- static_assert(foo(i), "Error"); // { dg-error "non-constant condition|not usable|non-constexpr" }
+ static_assert(foo(i), "Error"); // { dg-error "non-constant condition|not usable|non-.constexpr." }
return true;
}
diff --git a/gcc/testsuite/g++.dg/cpp1y/constexpr-70265-1.C b/gcc/testsuite/g++.dg/cpp1y/constexpr-70265-1.C
index e0fcdfe..902fe1de 100644
--- a/gcc/testsuite/g++.dg/cpp1y/constexpr-70265-1.C
+++ b/gcc/testsuite/g++.dg/cpp1y/constexpr-70265-1.C
@@ -10,4 +10,4 @@ foo (int p)
return t;
}
-static_assert (foo (1) == 0, ""); // { dg-error "non-constant" }
+static_assert (foo (1) == 0, ""); // { dg-error "non-constant|in .constexpr. expansion of " }
diff --git a/gcc/testsuite/g++.dg/cpp1y/constexpr-70265-2.C b/gcc/testsuite/g++.dg/cpp1y/constexpr-70265-2.C
index fc360f1..895870e 100644
--- a/gcc/testsuite/g++.dg/cpp1y/constexpr-70265-2.C
+++ b/gcc/testsuite/g++.dg/cpp1y/constexpr-70265-2.C
@@ -10,4 +10,4 @@ foo (int p)
return t;
}
-static_assert (foo (1) == 0, ""); // { dg-error "non-constant" }
+static_assert (foo (1) == 0, ""); // { dg-error "non-constant|in .constexpr. expansion of " }
diff --git a/gcc/testsuite/g++.dg/cpp1y/constexpr-79655.C b/gcc/testsuite/g++.dg/cpp1y/constexpr-79655.C
index 0be94b6..cc9ce6c 100644
--- a/gcc/testsuite/g++.dg/cpp1y/constexpr-79655.C
+++ b/gcc/testsuite/g++.dg/cpp1y/constexpr-79655.C
@@ -9,10 +9,10 @@ foo (int x, int y)
return a[y];
}
-constexpr int b = foo (0, -1); // { dg-error "is outside the bounds" }
-constexpr int c = foo (0, 6); // { dg-error "is outside the bounds" }
-constexpr int d = foo (6, 0); // { dg-error "is outside the bounds" }
-constexpr int e = foo (-1, 0); // { dg-error "is outside the bounds" }
+constexpr int b = foo (0, -1); // { dg-error "is outside the bounds|in .constexpr. expansion of " }
+constexpr int c = foo (0, 6); // { dg-error "is outside the bounds|in .constexpr. expansion of " }
+constexpr int d = foo (6, 0); // { dg-error "is outside the bounds|in .constexpr. expansion of " }
+constexpr int e = foo (-1, 0); // { dg-error "is outside the bounds|in .constexpr. expansion of " }
static_assert (foo (5, 5) == 0, "");
static_assert (foo (4, 5) == 6, "");
static_assert (foo (5, 4) == 5, "");
diff --git a/gcc/testsuite/g++.dg/cpp1y/constexpr-new.C b/gcc/testsuite/g++.dg/cpp1y/constexpr-new.C
index 7241fef..9e300b9 100644
--- a/gcc/testsuite/g++.dg/cpp1y/constexpr-new.C
+++ b/gcc/testsuite/g++.dg/cpp1y/constexpr-new.C
@@ -4,8 +4,8 @@ constexpr int *f4(bool b) {
if (b) {
return nullptr;
} else {
- return new int{42}; // { dg-error "call to non-constexpr" }
+ return new int{42}; // { dg-error "call to non-.constexpr." }
}
}
static_assert(f4(true) == nullptr, "");
-static_assert(f4(false) == nullptr, ""); // { dg-error "non-constant condition" }
+static_assert(f4(false) == nullptr, ""); // { dg-error "non-.constant. condition|" }
diff --git a/gcc/testsuite/g++.dg/cpp1y/constexpr-return2.C b/gcc/testsuite/g++.dg/cpp1y/constexpr-return2.C
index d330ccf..cb01854 100644
--- a/gcc/testsuite/g++.dg/cpp1y/constexpr-return2.C
+++ b/gcc/testsuite/g++.dg/cpp1y/constexpr-return2.C
@@ -5,4 +5,4 @@ constexpr int f (int i)
{
}
-constexpr int i = f(42); // { dg-error "flows off the end" }
+constexpr int i = f(42); // { dg-error "flows off the end|in .constexpr. expansion of " }
diff --git a/gcc/testsuite/g++.dg/cpp1y/constexpr-shift1.C b/gcc/testsuite/g++.dg/cpp1y/constexpr-shift1.C
index a739fd2..d63c954 100644
--- a/gcc/testsuite/g++.dg/cpp1y/constexpr-shift1.C
+++ b/gcc/testsuite/g++.dg/cpp1y/constexpr-shift1.C
@@ -5,5 +5,5 @@ constexpr __PTRDIFF_TYPE__ bar (int a)
{
return ((__PTRDIFF_TYPE__) &p) << a; // { dg-error "is not a constant expression" }
}
-constexpr __PTRDIFF_TYPE__ r = bar (2);
+constexpr __PTRDIFF_TYPE__ r = bar (2); // { dg-message "in .constexpr. expansion of" }
constexpr __PTRDIFF_TYPE__ s = bar (0); // { dg-error "conversion from pointer" }
diff --git a/gcc/testsuite/g++.dg/cpp1y/constexpr-throw.C b/gcc/testsuite/g++.dg/cpp1y/constexpr-throw.C
index 21629a7..3bbc8ac 100644
--- a/gcc/testsuite/g++.dg/cpp1y/constexpr-throw.C
+++ b/gcc/testsuite/g++.dg/cpp1y/constexpr-throw.C
@@ -31,4 +31,4 @@ constexpr int fun(int n) {
}
static_assert(fun(0), "");
-static_assert(fun(1), ""); // { dg-error "non-constant" }
+static_assert(fun(1), ""); // { dg-error "non-constant|in .constexpr. expansion of" }
diff --git a/gcc/testsuite/g++.dg/cpp1y/pr63996.C b/gcc/testsuite/g++.dg/cpp1y/pr63996.C
index da1e076..2e8cab5 100644
--- a/gcc/testsuite/g++.dg/cpp1y/pr63996.C
+++ b/gcc/testsuite/g++.dg/cpp1y/pr63996.C
@@ -7,5 +7,4 @@ foo (int i)
int a[i] = { }; // { dg-error "forbids variable length" }
}
-constexpr int j = foo (1); // { dg-error "flows off the end" }
-
+constexpr int j = foo (1); // { dg-error "flows off the end|in .constexpr. expansion of" }
diff --git a/gcc/testsuite/g++.dg/cpp1y/pr68180.C b/gcc/testsuite/g++.dg/cpp1y/pr68180.C
index 5c8ec53..9e6e5e9 100644
--- a/gcc/testsuite/g++.dg/cpp1y/pr68180.C
+++ b/gcc/testsuite/g++.dg/cpp1y/pr68180.C
@@ -11,6 +11,6 @@ constexpr float32x4_t fill(float x) {
}
float32x4_t foo(float32x4_t x) {
- constexpr float32x4_t v = fill(1.f); // { dg-error "not a constant" }
+ constexpr float32x4_t v = fill(1.f); // { dg-error "not a constant||in .constexpr. expansion of " }
return x+v;
}
diff --git a/gcc/testsuite/g++.dg/cpp1y/pr77830.C b/gcc/testsuite/g++.dg/cpp1y/pr77830.C
index 9235b40..6fcb1ba 100644
--- a/gcc/testsuite/g++.dg/cpp1y/pr77830.C
+++ b/gcc/testsuite/g++.dg/cpp1y/pr77830.C
@@ -23,12 +23,12 @@ bar (T... a)
const char *s[]{a...};
P<sizeof...(a)> p{};
for (auto i = 0; i < sizeof...(a); ++i)
- p.foo (s[i], i);
+ p.foo (s[i], i); // { dg-message "in .constexpr. expansion of " }
return p;
}
int
main ()
{
- constexpr auto a = bar ("", ""); // { dg-error "outside the bounds of array type" }
+ constexpr auto a = bar ("", ""); // { dg-error "outside the bounds of array type|in .constexpr. expansion of " }
}
diff --git a/gcc/testsuite/g++.dg/cpp1z/constexpr-lambda6.C b/gcc/testsuite/g++.dg/cpp1z/constexpr-lambda6.C
index 3fe4bb9..cd7c5b9 100644
--- a/gcc/testsuite/g++.dg/cpp1z/constexpr-lambda6.C
+++ b/gcc/testsuite/g++.dg/cpp1z/constexpr-lambda6.C
@@ -24,6 +24,6 @@ int main()
// expression.
auto two = monoid(2);
if (!(two() == 2)) __builtin_abort(); // OK, not a constant expression.
- static_assert(add(one)(one)() == two()); // { dg-error "" } two() is not a constant expression
+ static_assert(add(one)(one)() == two()); // { dg-error "|in .constexpr. expansion of " } two() is not a constant expression
static_assert(add(one)(one)() == monoid(2)()); // OK
}
diff --git a/gcc/testsuite/g++.dg/ext/constexpr-vla1.C b/gcc/testsuite/g++.dg/ext/constexpr-vla1.C
index 21eb93d..aff1d21 100644
--- a/gcc/testsuite/g++.dg/ext/constexpr-vla1.C
+++ b/gcc/testsuite/g++.dg/ext/constexpr-vla1.C
@@ -27,4 +27,4 @@ fn_not_ok (int n)
}
constexpr int n1 = fn_ok (3);
-constexpr int n2 = fn_not_ok (3); // { dg-error "array subscript" }
+constexpr int n2 = fn_not_ok (3); // { dg-error "array subscript|in .constexpr. expansion of " }
diff --git a/gcc/testsuite/g++.dg/ext/constexpr-vla2.C b/gcc/testsuite/g++.dg/ext/constexpr-vla2.C
index 6aab1843..d4ea7c5 100644
--- a/gcc/testsuite/g++.dg/ext/constexpr-vla2.C
+++ b/gcc/testsuite/g++.dg/ext/constexpr-vla2.C
@@ -5,7 +5,7 @@ constexpr int
fn_bad (int n)
{
__extension__ int a [n] = { 0 };
- int z = a [0] + (n ? fn_bad (n - 1) : 0);
+ int z = a [0] + (n ? fn_bad (n - 1) : 0); // { dg-message "in .constexpr. expansion of " }
return z;
}
@@ -18,4 +18,4 @@ fn_ok (int n)
}
constexpr int i1 = fn_ok (3);
-constexpr int i2 = fn_bad (3); // { dg-error "array subscript" }
+constexpr int i2 = fn_bad (3); // { dg-error "array subscript|in .constexpr. expansion of " }
diff --git a/gcc/testsuite/g++.dg/ext/constexpr-vla3.C b/gcc/testsuite/g++.dg/ext/constexpr-vla3.C
index 33fc968..538b576 100644
--- a/gcc/testsuite/g++.dg/ext/constexpr-vla3.C
+++ b/gcc/testsuite/g++.dg/ext/constexpr-vla3.C
@@ -11,4 +11,4 @@ foo (int n)
return z;
}
-constexpr int n = foo (3); // { dg-error "array subscript" }
+constexpr int n = foo (3); // { dg-error "array subscript|in .constexpr. expansion of " }
diff --git a/gcc/testsuite/g++.dg/ubsan/pr63956.C b/gcc/testsuite/g++.dg/ubsan/pr63956.C
index bce7b1c..34b5dd7 100644
--- a/gcc/testsuite/g++.dg/ubsan/pr63956.C
+++ b/gcc/testsuite/g++.dg/ubsan/pr63956.C
@@ -17,11 +17,11 @@ fn1 (int a, int b)
}
constexpr int i1 = fn1 (5, 3);
-constexpr int i2 = fn1 (5, -2); // { dg-message "in constexpr expansion" }
-constexpr int i3 = fn1 (5, sizeof (int) * __CHAR_BIT__); // { dg-message "in constexpr expansion" }
-constexpr int i4 = fn1 (5, 256); // { dg-message "in constexpr expansion" }
+constexpr int i2 = fn1 (5, -2); // { dg-message "in .constexpr. expansion" }
+constexpr int i3 = fn1 (5, sizeof (int) * __CHAR_BIT__); // { dg-message "in .constexpr. expansion" }
+constexpr int i4 = fn1 (5, 256); // { dg-message "in .constexpr. expansion" }
constexpr int i5 = fn1 (5, 2);
-constexpr int i6 = fn1 (-2, 4); // { dg-message "in constexpr expansion" }
+constexpr int i6 = fn1 (-2, 4); // { dg-message "in .constexpr. expansion" }
constexpr int i7 = fn1 (0, 2);
SA (i1 == 40);
@@ -40,9 +40,9 @@ fn2 (int a, int b)
}
constexpr int j1 = fn2 (4, 1);
-constexpr int j2 = fn2 (4, -1); // { dg-message "in constexpr expansion" }
-constexpr int j3 = fn2 (10, sizeof (int) * __CHAR_BIT__); // { dg-message "in constexpr expansion" }
-constexpr int j4 = fn2 (1, 256); // { dg-message "in constexpr expansion" }
+constexpr int j2 = fn2 (4, -1); // { dg-message "in .constexpr. expansion" }
+constexpr int j3 = fn2 (10, sizeof (int) * __CHAR_BIT__); // { dg-message "in .constexpr. expansion" }
+constexpr int j4 = fn2 (1, 256); // { dg-message "in .constexpr. expansion" }
constexpr int j5 = fn2 (5, 2);
constexpr int j6 = fn2 (-2, 4);
constexpr int j7 = fn2 (0, 4);
@@ -60,8 +60,8 @@ fn3 (int a, int b)
}
constexpr int k1 = fn3 (8, 4);
-constexpr int k2 = fn3 (7, 0); // { dg-message "in constexpr expansion" }
-constexpr int k3 = fn3 (INT_MIN, -1); // { dg-error "overflow in constant expression" }
+constexpr int k2 = fn3 (7, 0); // { dg-message "in .constexpr. expansion" }
+constexpr int k3 = fn3 (INT_MIN, -1); // { dg-error "overflow in constant expression|in .constexpr. expansion of " }
SA (k1 == 2);
@@ -74,7 +74,7 @@ fn4 (float a, float b)
}
constexpr float l1 = fn4 (5.0, 3.0);
-constexpr float l2 = fn4 (7.0, 0.0); // { dg-message "in constexpr expansion" }
+constexpr float l2 = fn4 (7.0, 0.0); // { dg-message "in .constexpr. expansion" }
constexpr int
fn5 (const int *a, int b)
@@ -86,7 +86,7 @@ fn5 (const int *a, int b)
constexpr int m1[4] = { 1, 2, 3, 4 };
constexpr int m2 = fn5 (m1, 3);
-constexpr int m3 = fn5 (m1, 4); // { dg-error "array subscript" }
+constexpr int m3 = fn5 (m1, 4); // { dg-error "array subscript|in .constexpr. expansion of " }
constexpr int
fn6 (const int &a, int b)
@@ -106,7 +106,7 @@ fn7 (const int *a, int b)
constexpr int n1 = 7;
constexpr int n2 = fn7 (&n1, 5);
-constexpr int n3 = fn7 ((const int *) 0, 8); // { dg-error "null pointer" }
+constexpr int n3 = fn7 ((const int *) 0, 8); // { dg-error "null pointer|in .constexpr. expansion of " }
constexpr int
fn8 (int i)
@@ -116,7 +116,7 @@ fn8 (int i)
}
constexpr int o1 = fn8 (9);
-constexpr int o2 = fn8 (10); // { dg-error "array subscript" }
+constexpr int o2 = fn8 (10); // { dg-error "array subscript|in .constexpr. expansion of " }
constexpr int
fn9 (int a, int b)
@@ -127,10 +127,10 @@ fn9 (int a, int b)
}
constexpr int p1 = fn9 (42, 7);
-constexpr int p2 = fn9 (__INT_MAX__, 1); // { dg-error "overflow in constant expression" }
+constexpr int p2 = fn9 (__INT_MAX__, 1); // { dg-error "overflow in constant expression|in .constexpr. expansion of " }
constexpr int p3 = fn9 (__INT_MAX__, -1);
constexpr int p4 = fn9 (INT_MIN, 1);
-constexpr int p5 = fn9 (INT_MIN, -1); // { dg-error "overflow in constant expression" }
+constexpr int p5 = fn9 (INT_MIN, -1); // { dg-error "overflow in constant expression|in .constexpr. expansion of " }
SA (p1 == 49);
SA (p3 == __INT_MAX__ - 1);
@@ -145,8 +145,8 @@ fn10 (int a, int b)
}
constexpr int q1 = fn10 (10, 10);
-constexpr int q2 = fn10 (__INT_MAX__, 2); // { dg-error "overflow in constant expression" }
-constexpr int q3 = fn10 (INT_MIN, 2); // { dg-error "overflow in constant expression" }
+constexpr int q2 = fn10 (__INT_MAX__, 2); // { dg-error "overflow in constant expression|in .constexpr. expansion of " }
+constexpr int q3 = fn10 (INT_MIN, 2); // { dg-error "overflow in constant expression|in .constexpr. expansion of " }
constexpr int q4 = fn10 (-1, -1);
SA (q1 == 100);
@@ -162,7 +162,7 @@ fn11 (double d)
}
constexpr int r1 = fn11 (3.4);
-constexpr int r2 = fn11 (__builtin_inf ()); // { dg-error "overflow in constant expression" }
+constexpr int r2 = fn11 (__builtin_inf ()); // { dg-error "overflow in constant expression|in .constexpr. expansion of " }
constexpr int
fn12 (int i)
@@ -173,6 +173,6 @@ fn12 (int i)
}
constexpr int s1 = fn12 (1);
-constexpr int s2 = fn12 (42);
+constexpr int s2 = fn12 (42); // { dg-message "in .constexpr. expansion of " }
SA (s1 == 11);