]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR c++/17618 (ICE in cp_convert_to_pointer, at cp/cvt.c:83)
authorVolker Reichelt <reichelt@igpm.rwth-aachen.de>
Tue, 11 Oct 2005 00:39:26 +0000 (00:39 +0000)
committerVolker Reichelt <reichelt@gcc.gnu.org>
Tue, 11 Oct 2005 00:39:26 +0000 (00:39 +0000)
Backport:
2004-09-23  Andrew Pinski  <pinskia@physics.uc.edu>
PR c++/17618
* cvt.c (cp_convert_to_pointer): Return early when the type is
an error_mark_node.

2004-05-22  Roger Sayle  <roger@eyesopen.com>
* name-lookup.c (check_for_out_of_scope_variable): Avoid ICE by
returning when TREE_TYPE is error_mark_node.
* typeck.c (require_complete_type): Return error_mark_node if
value's type is an error_mark_node.

2004-11-02  Mark Mitchell  <mark@codesourcery.com>
PR c++/18177
* typeck.c (build_const_cast): Use error_operand_p.

2004-09-23  Andrew Pinski  <pinskia@physics.uc.edu>
PR c++/17618
* g++.dg/lookup/crash5.C: New test.

2004-05-22  Wolfgang Bangerth  <bangerth@dealii.org>
    Roger Sayle  <roger@eyesopen.com>
* g++.dg/lookup/forscope2.C: New test case.

2004-11-02  Mark Mitchell  <mark@codesourcery.com>
PR c++/18177
* g++.dg/conversion/const3.C: New test.

From-SVN: r105210

gcc/cp/ChangeLog
gcc/cp/cvt.c
gcc/cp/name-lookup.c
gcc/cp/typeck.c
gcc/testsuite/ChangeLog

index ef4a00b8ec9f3ca844907bb6b6c51937f71ff17c..fcc35668a8eb1f82b8faae420d74a9e948d36e84 100644 (file)
@@ -1,3 +1,21 @@
+2005-10-11  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
+
+       Backport:
+       2004-09-23  Andrew Pinski  <pinskia@physics.uc.edu>
+       PR c++/17618
+       * cvt.c (cp_convert_to_pointer): Return early when the type is
+       an error_mark_node.
+
+       2004-05-22  Roger Sayle  <roger@eyesopen.com>
+       * name-lookup.c (check_for_out_of_scope_variable): Avoid ICE by
+       returning when TREE_TYPE is error_mark_node.
+       * typeck.c (require_complete_type): Return error_mark_node if
+       value's type is an error_mark_node.
+
+       2004-11-02  Mark Mitchell  <mark@codesourcery.com>
+       PR c++/18177
+       * typeck.c (build_const_cast): Use error_operand_p.
+
 2005-10-06  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
 
        * call.c (resolve_args): Remove redundant test.
index 8276451cb10cb7c93db2026d0a28ff1477ebc433..2071c260299c66875c623b2fef977aeedb66df9c 100644 (file)
@@ -79,6 +79,8 @@ cp_convert_to_pointer (tree type, tree expr, bool force)
   tree intype = TREE_TYPE (expr);
   enum tree_code form;
   tree rval;
+  if (intype == error_mark_node)
+    return error_mark_node;
 
   if (IS_AGGR_TYPE (intype))
     {
index 71894db10583061dba48e1ffd07e661e6b114db2..7cefe2e661cfb90294c8e97dd477c95e6ff0232c 100644 (file)
@@ -1179,6 +1179,10 @@ check_for_out_of_scope_variable (tree decl)
     return decl;
 
   DECL_ERROR_REPORTED (decl) = 1;
+
+  if (TREE_TYPE (decl) == error_mark_node)
+    return decl;
+
   if (TYPE_HAS_NONTRIVIAL_DESTRUCTOR (TREE_TYPE (decl)))
     {
       error ("name lookup of `%D' changed for new ISO `for' scoping",
index 50e2ea9e52b689ccdca2ff93365f380b1250a75d..b13fb857d695caf657cf728bfbcacad490b70b7d 100644 (file)
@@ -95,6 +95,9 @@ require_complete_type (tree value)
   else
     type = TREE_TYPE (value);
 
+  if (type == error_mark_node)
+    return error_mark_node;
+
   /* First, detect a valid value with a complete type.  */
   if (COMPLETE_TYPE_P (type))
     return value;
@@ -4794,7 +4797,7 @@ build_const_cast (tree type, tree expr)
 {
   tree intype;
 
-  if (type == error_mark_node || expr == error_mark_node)
+  if (type == error_mark_node || error_operand_p (expr))
     return error_mark_node;
 
   if (processing_template_decl)
index f24a7c624d8db0f8b21262ef1d98399a11499574..3fc5ef8d2e18a696951579c331b1d16084bb316d 100644 (file)
@@ -1,3 +1,18 @@
+2005-10-11  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
+
+       Backport:
+       2004-09-23  Andrew Pinski  <pinskia@physics.uc.edu>
+       PR c++/17618
+       * g++.dg/lookup/crash5.C: New test.
+
+       2004-05-22  Wolfgang Bangerth  <bangerth@dealii.org>
+                   Roger Sayle  <roger@eyesopen.com>
+       * g++.dg/lookup/forscope2.C: New test case.
+
+       2004-11-02  Mark Mitchell  <mark@codesourcery.com>
+       PR c++/18177
+       * g++.dg/conversion/const3.C: New test.
+
 2005-10-08  Janis Johnson  <janis187@us.ibm.com>
 
        PR debug/24267