Bug 28559 - [4.2 regression] ICE with friend and __attribute__
Summary: [4.2 regression] ICE with friend and __attribute__
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.2.0
: P2 normal
Target Milestone: 4.2.0
Assignee: Jason Merrill
URL:
Keywords: ice-on-valid-code, monitored
Depends on:
Blocks:
 
Reported: 2006-07-31 21:45 UTC by Volker Reichelt
Modified: 2006-08-15 05:55 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2006-08-10 19:03:06


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Volker Reichelt 2006-07-31 21:45:53 UTC
The following (probably valid) code snippet triggers an ICE on mainline:

======================================================================
template<typename T> struct A
{
  struct B;
};

struct C
{
  template<typename T> friend struct __attribute__((packed)) A<T>::B;
};
======================================================================

bug.cc:8: internal compiler error: Segmentation fault
Please submit a full bug report, [etc.]
Comment 1 Janis Johnson 2006-08-09 00:36:18 UTC
A regression hunt on powerpc-linux identified this large patch:

    http://gcc.gnu.org/viewcvs?view=rev&rev=115086
                                                                                
    r115086 | jason | 2006-06-30 01:15:56 +0000 (Fri, 30 Jun 2006)
Comment 2 Jason Merrill 2006-08-14 21:25:12 UTC
Subject: Bug 28559

Author: jason
Date: Mon Aug 14 21:25:03 2006
New Revision: 116137

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=116137
Log:
        PR c++/28559
        * parser.c (cp_parser_elaborated_type_specifier): Also ignore
        attributes applied to a TYPENAME_TYPE.

Added:
    trunk/gcc/testsuite/g++.dg/ext/attrib25.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/parser.c

Comment 3 Andrew Pinski 2006-08-15 05:55:00 UTC
Fixed.