]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
PR C++/13429, C/11944
authorAndrew Pinski <pinskia@physics.uc.edu>
Thu, 25 Dec 2003 16:21:34 +0000 (16:21 +0000)
committerAndrew Pinski <pinskia@gcc.gnu.org>
Thu, 25 Dec 2003 16:21:34 +0000 (08:21 -0800)
2003-12-25  Andrew Pinski  <pinskia@physics.uc.edu>

        PR C++/13429, C/11944
        * c-common.c (c_build_qualified_type): Return early when type is
        error_mark_node.
        (c_apply_type_quals_to_decl): Likewise.

From-SVN: r75021

gcc/ChangeLog
gcc/c-common.c

index 3006e1ef7f43b057c618a5819fe5b83ce899e81a..5714a06ee1f120391fe06081981ce8268846b9ef 100644 (file)
@@ -1,3 +1,10 @@
+2003-12-25  Andrew Pinski  <pinskia@physics.uc.edu>
+
+       PR C++/13429, C/11944
+       * c-common.c (c_build_qualified_type): Return early when type is 
+       error_mark_node.
+       (c_apply_type_quals_to_decl): Likewise.
+
 2003-12-25  Kazu Hirata  <kazu@cs.umass.edu>
 
        * config/alpha/alpha-modes.def: Fix comment formatting.
index 9cdd144109876b0d704a30acd5f038f8bec2d26f..3ba73dd2722f2943486029d3292291d8bd5eb86e 100644 (file)
@@ -2784,6 +2784,9 @@ static tree builtin_function_2 (const char *, const char *, tree, tree,
 tree
 c_build_qualified_type (tree type, int type_quals)
 {
+  if (type == error_mark_node)
+    return type;
+  
   if (TREE_CODE (type) == ARRAY_TYPE)
     return build_array_type (c_build_qualified_type (TREE_TYPE (type),
                                                     type_quals),
@@ -2809,6 +2812,9 @@ void
 c_apply_type_quals_to_decl (int type_quals, tree decl)
 {
   tree type = TREE_TYPE (decl);
+  
+  if (type == error_mark_node)
+    return;
 
   if (((type_quals & TYPE_QUAL_CONST)
        || (type && TREE_CODE (type) == REFERENCE_TYPE))