]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Add quotes for constexpr keyword.
authorMartin Liska <mliska@suse.cz>
Tue, 21 Nov 2017 18:58:49 +0000 (19:58 +0100)
committerMartin Liska <marxin@gcc.gnu.org>
Tue, 21 Nov 2017 18:58:49 +0000 (18:58 +0000)
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

39 files changed:
gcc/cp/ChangeLog
gcc/cp/class.c
gcc/cp/constexpr.c
gcc/cp/decl.c
gcc/cp/error.c
gcc/cp/method.c
gcc/cp/parser.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/constexpr-48089.C
gcc/testsuite/g++.dg/cpp0x/constexpr-50060.C
gcc/testsuite/g++.dg/cpp0x/constexpr-60049.C
gcc/testsuite/g++.dg/cpp0x/constexpr-70323.C
gcc/testsuite/g++.dg/cpp0x/constexpr-70323a.C
gcc/testsuite/g++.dg/cpp0x/constexpr-cast.C
gcc/testsuite/g++.dg/cpp0x/constexpr-diag3.C
gcc/testsuite/g++.dg/cpp0x/constexpr-ex1.C
gcc/testsuite/g++.dg/cpp0x/constexpr-generated1.C
gcc/testsuite/g++.dg/cpp0x/constexpr-ice16.C
gcc/testsuite/g++.dg/cpp0x/constexpr-ice5.C
gcc/testsuite/g++.dg/cpp0x/constexpr-incomplete2.C
gcc/testsuite/g++.dg/cpp0x/constexpr-neg1.C
gcc/testsuite/g++.dg/cpp0x/constexpr-recursion.C
gcc/testsuite/g++.dg/cpp0x/constexpr-shift1.C
gcc/testsuite/g++.dg/cpp0x/static_assert10.C
gcc/testsuite/g++.dg/cpp1y/constexpr-70265-1.C
gcc/testsuite/g++.dg/cpp1y/constexpr-70265-2.C
gcc/testsuite/g++.dg/cpp1y/constexpr-79655.C
gcc/testsuite/g++.dg/cpp1y/constexpr-new.C
gcc/testsuite/g++.dg/cpp1y/constexpr-return2.C
gcc/testsuite/g++.dg/cpp1y/constexpr-shift1.C
gcc/testsuite/g++.dg/cpp1y/constexpr-throw.C
gcc/testsuite/g++.dg/cpp1y/pr63996.C
gcc/testsuite/g++.dg/cpp1y/pr68180.C
gcc/testsuite/g++.dg/cpp1y/pr77830.C
gcc/testsuite/g++.dg/cpp1z/constexpr-lambda6.C
gcc/testsuite/g++.dg/ext/constexpr-vla1.C
gcc/testsuite/g++.dg/ext/constexpr-vla2.C
gcc/testsuite/g++.dg/ext/constexpr-vla3.C
gcc/testsuite/g++.dg/ubsan/pr63956.C

index 8a6328a8bffdac6cd64acf353d1511d3b75a436d..42252bf20cdf0e683f87126114e40905e0e0cc71 100644 (file)
@@ -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,
index 586a32c436f7960fa172d43af8d47dff15027e20..529f37f24eefb49a578d0d69273f75e27a39f4ff 100644 (file)
@@ -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
index 34a9c6b9d507cf0149d08f9bfad68c420645685c..92f51910cb5e7188e0291e1f933ab46822117a5b 100644 (file)
@@ -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);
                      }
index 54e06568e4662b343691e261e2ca06e2695935e6..a7cb61506eef2cf21f2d2f0563cbddd22461b2cb 100644 (file)
@@ -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;
          }
 
index 7125b88e29e529a1adb33248d949f54802b7390f..6d1f3da74e2eff5722a2dcd0a9df0d921f427aa7 100644 (file)
@@ -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);
     }
index 714b50879910f516538997af607b0e10af0fe04d..534aaa32fd5c9703129a70c2ba4e44c533e6273f 100644 (file)
@@ -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;
index b06170482097740901ce8dac6103a08ec0a7bb31..1ad351cdbd7fa22ed4de19b2b6308c9a067beaa2 100644 (file)
@@ -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.  */
index eb333c1251a0a929f7beb7e09154ea2e1cee519a..42282509f300ce1275b058be3d0ee5d250345902 100644 (file)
@@ -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
index 31010ed2355f5a5f686d25c4dbe1d4531803d990..4574eb83ff765ebb632b226239240a45527cad12 100644 (file)
@@ -14,7 +14,7 @@ struct s {
   int v;
 };
 
-constexpr s bang;              // { dg-error "" }
+constexpr s bang;              // { dg-error "|" }
 
 struct R {
   int i,j;
index d2df08e7ca935e4419929e4e3cba2db6c0adf8ce..d99142882419eeb05d487f83469a292c127b3473 100644 (file)
@@ -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 } } }
index 3a1ee811c6346d1fa8626a447ecc9e063ff94af5..172963f1fc4ab12f8e3a4fbe8e41b3f7be42d0d5 100644 (file)
@@ -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" }
index 8307ac8e0a691489d395ff8e1c2169f7185266d9..272a225d967e1e73aa0f9d4d2307e2ad3a5abada 100644 (file)
@@ -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 " }
index d166787ca8b31fb71e75d1eb1ade2676ac18260b..1990ab6be2d81f0cceb29090265a335822160417 100644 (file)
@@ -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" }
index e23d0d47889e7d30d7efbb4744df2b72e03d3052..1ed01c88ff59898d30e2f34436e2393ecda40761 100644 (file)
@@ -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 " }
index 27aad93e6c3cedafc606c4ebf07c2e03aaad4b58..fc5a721085333cfb9d0fd480521a38cf602c678f 100644 (file)
@@ -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" }
index c4c052a607ad6a702a407c453dbeee67848ef007..e5e58bddab0b2fa8a37cd0395cb853a957250518 100644 (file)
@@ -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
index 39be3ed571f10273ae16271979a765f9b38eee43..4b0d68bf6613c577842e66df38147f35e6c91274 100644 (file)
@@ -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
index 42b9226dcd3aa56f664897b4d00d5952ec2298ca..112415b655bfaa3e57606c22cb3ce02f2ed9513b 100644 (file)
@@ -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 " }
index c5a117c02dd10567d5412e5897a3e59192209627..51b328e2598098f6d330e96751674920426ec8fb 100644 (file)
@@ -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." }
 };
index a8af2e66f2a07ded4bb8c5a9e422cfe34fe4c466..a04f1d51d22c7666312fd1d87497cf6dea74879b 100644 (file)
@@ -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" }
index 9c832b14cbcc64c5411b0e2c2c94d33a68557dea..336699292a2eb4193b71c14c21725d7bc0bf0bfa 100644 (file)
@@ -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:
index e3e13f755f958cccc6f21380e042c2e4c9c48404..8c4201e1ec2e3d1b16279a2fd77e1dadf6c22d19 100644 (file)
@@ -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 " }
index 1f4ee73d1b7abdae7e7568f4ca0428fb22d82393..4abd9e0cfb6bf6e15a49971f6959e906bcab3828 100644 (file)
@@ -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 " }
index ffbf3c047eb91ed275bc0d661a227ddaaa4caf18..5ff085487cc552aa86745624f42f07482bbb0f0d 100644 (file)
@@ -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;
 }
index e0fcdfeb69383695ae2742027e304fa750ce4687..902fe1defbdcefc00fc52c4357fea3fcbbd8b200 100644 (file)
@@ -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 " }
index fc360f1a9bbd58d51377d4fa3cce85c777e0869c..895870effe11759db3eee867cc695d8fb8108abf 100644 (file)
@@ -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 " }
index 0be94b6b810f0b40ca0e2a04953e8ebe527c736c..cc9ce6c505ea5ee6fd29f40aae9c9496062c9ca4 100644 (file)
@@ -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, "");
index 7241fefc41e5c41cf64b0ca346eb8176b459ef2d..9e300b9a8669ec745541b30626cdab15c7ab32b5 100644 (file)
@@ -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|" }
index d330ccfed3e66ada57a25ad512ca53fc97a85e0e..cb0185414afedc332241cb206afd6c05f699f478 100644 (file)
@@ -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 " }
index a739fd2dfae24780517302cd968d9f35d5e29ac8..d63c954f42f7c3ce2115a8677dcdda909bd1eb00 100644 (file)
@@ -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" }
index 21629a7990abd90bf7df28d894f67e029dbf9cde..3bbc8ac1b888f3e962fbe27e01837403047ad2f6 100644 (file)
@@ -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" }
index da1e0764a100849a7ebc5385b57a81d29314480f..2e8cab58a7a0c3c0f9cab66afc2d527a0813cc7f 100644 (file)
@@ -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" }
index 5c8ec534f334e1e38161537b1a037c725d071316..9e6e5e984f9977ff53b4f7456a7823ee0cc5fb5e 100644 (file)
@@ -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;
 }
index 9235b405225c3915c3837940fe516a0a8d04548c..6fcb1ba8847049921e4b5184cec6c6a22d261f8e 100644 (file)
@@ -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 " }
 }
index 3fe4bb949bdde8b02315ece8675eaae532246fcd..cd7c5b9f3efc39f7eef43b2d25cb83acf611e94e 100644 (file)
@@ -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
 }
index 21eb93dc65429c34ed1f74adc48980062d362a75..aff1d21a4b7badbe288fd42576e93b13946e472b 100644 (file)
@@ -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 " }
index 6aab18436d52836a49e35968354a1fd3354d9028..d4ea7c58c0d8d051adbbeca8b3545158ca26747e 100644 (file)
@@ -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 " }
index 33fc968ad5a6e536f875a813990b1d31daecba8d..538b576a8255cf3bb84e94d7c4df89e20aa4e114 100644 (file)
@@ -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 " }
index bce7b1cd2daa399096ef7d8798f12315e8109311..34b5dd71ec2d142393db869a485015283468bf8d 100644 (file)
@@ -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);