The following invalid code snippet triggers an ICE since GCC 4.0.0
(and in GCC 3.4.0 - 3.4.3):

===============================
void foo(int i)
{
  (i ? 1 : 2) = ({ X; });
}
===============================

bug.cc: In function 'void foo(int)':
bug.cc:3: error: 'X' was not declared in this scope
bug.cc:3: internal compiler error: in build_target_expr_with_type, at
cp/tree.c:326
Please submit a full bug report, [etc.]


An ICE in the same place can be triggered with the following code snippet:

===============================
struct A
{
  ~A ();
  void foo()
  {
    delete this = ({ X; });
  }
};
===============================

bug.cc: In member function 'void A::foo()':
bug.cc:6: error: 'X' was not declared in this scope
bug.cc:6: internal compiler error: in build_target_expr_with_type, at
cp/tree.c:326
Please submit a full bug report, [etc.]


-- 
           Summary: [4.0/4.1/4.2/4.3 regression] ICE with invalid statement-
                    expressions
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code, error-recovery, monitored
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: reichelt at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30158

Reply via email to