Hello,

an error message like the following:

error: unable to find numeric literal operator 'operator"" iF'

for using _Complex_I can be a bit hard for users to handle. This adds a note that -std=gnu++11 and -fext-numeric-literals might help. Ideally we would check if the suffix is indeed recognized by -fext-numeric-literals before printing this text, but that's harder, someone else can do that later.

No testcase because notes are pruned in the testsuite.

Bootstrap+testsuite on x86_64-unknown-linux-gnu.

2014-01-01  Marc Glisse  <marc.gli...@inria.fr>

        PR c++/59087
gcc/cp/
        * parser.c (cp_parser_userdef_numeric_literal): Mention
        -fext-numeric-literals in the message.

--
Marc Glisse
Index: gcc/cp/parser.c
===================================================================
--- gcc/cp/parser.c     (revision 206274)
+++ gcc/cp/parser.c     (working copy)
@@ -3918,20 +3918,23 @@ cp_parser_userdef_numeric_literal (cp_pa
       result = finish_call_expr (decl, &args, false, true, tf_none);
       if (result != error_mark_node)
        {
          release_tree_vector (args);
          return result;
        }
     }
   release_tree_vector (args);
 
   error ("unable to find numeric literal operator %qD", name);
+  if (!cpp_get_options (parse_in)->ext_numeric_literals)
+    inform (token->location, "use -std=gnu++11 or -fext-numeric-literals "
+           "to enable more built-in suffixes");
   return error_mark_node;
 }
 
 /* Parse a user-defined string constant.  Returns a call to a user-defined
    literal operator taking a character pointer and the length of the string
    as arguments.  */
 
 static tree
 cp_parser_userdef_string_literal (cp_token *token)
 {

Reply via email to