]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/cp/decl.c
/cp
[thirdparty/gcc.git] / gcc / cp / decl.c
index 23e04e57e6994447b063f18a6f03920bee80bc13..35fa9e92aa57d3945c55874bc7991987a5054ea2 100644 (file)
@@ -4912,9 +4912,9 @@ check_tag_decl (cp_decl_specifier_seq *declspecs,
              "multiple types in one declaration");
   else if (declspecs->redefined_builtin_type)
     {
-      if (!in_system_header_at (input_location))
-       permerror (declspecs->locations[ds_redefined_builtin_type_spec],
-                  "redeclaration of C++ built-in type %qT",
+      location_t loc = declspecs->locations[ds_redefined_builtin_type_spec];
+      if (!in_system_header_at (loc))
+       permerror (loc, "redeclaration of C++ built-in type %qT",
                   declspecs->redefined_builtin_type);
       return NULL_TREE;
     }
@@ -4963,7 +4963,8 @@ check_tag_decl (cp_decl_specifier_seq *declspecs,
         --end example]  */
       if (saw_typedef)
        {
-         error ("missing type-name in typedef-declaration");
+         error_at (declspecs->locations[ds_typedef],
+                   "missing type-name in typedef-declaration");
          return NULL_TREE;
        }
       /* Anonymous unions are objects, so they can have specifiers.  */;
@@ -9307,7 +9308,6 @@ grokfndecl (tree ctype,
            }
          /* 17.6.3.3.5  */
          if (suffix[0] != '_'
-             && !in_system_header_at (location)
              && !current_function_decl && !(friendp && !funcdef_flag))
            warning_at (location, OPT_Wliteral_suffix,
                        "literal operator suffixes not preceded by %<_%>"
@@ -10015,8 +10015,6 @@ compute_array_index_type_loc (location_t name_loc, tree name, tree size,
               indicated by the state of complain), so that
               another substitution can be found.  */
            return error_mark_node;
-         else if (in_system_header_at (input_location))
-           /* Allow them in system headers because glibc uses them.  */;
          else if (name)
            pedwarn (loc, OPT_Wpedantic,
                     "ISO C++ forbids zero-size array %qD", name);
@@ -10983,7 +10981,7 @@ grokdeclarator (const cp_declarator *declarator,
 
       if (type_was_error_mark_node)
        /* We've already issued an error, don't complain more.  */;
-      else if (in_system_header_at (input_location) || flag_ms_extensions)
+      else if (in_system_header_at (id_loc) || flag_ms_extensions)
        /* Allow it, sigh.  */;
       else if (! is_main)
        permerror (id_loc, "ISO C++ forbids declaration of %qs with no type",
@@ -11016,7 +11014,7 @@ grokdeclarator (const cp_declarator *declarator,
        }
       /* Don't pedwarn if the alternate "__intN__" form has been used instead
         of "__intN".  */
-      else if (!int_n_alt && pedantic && ! in_system_header_at (input_location))
+      else if (!int_n_alt && pedantic)
        pedwarn (declspecs->locations[ds_type_spec], OPT_Wpedantic,
                 "ISO C++ does not support %<__int%d%> for %qs",
                 int_n_data[declspecs->int_n_idx].bitsize, name);
@@ -12674,10 +12672,7 @@ grokdeclarator (const cp_declarator *declarator,
            else
              {
                /* Array is a flexible member.  */
-               if (in_system_header_at (input_location))
-                 /* Do not warn on flexible array members in system
-                    headers because glibc uses them.  */;
-               else if (name)
+               if (name)
                  pedwarn (id_loc, OPT_Wpedantic,
                           "ISO C++ forbids flexible array member %qs", name);
                else