This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

c++/10594: [3.3 regression] ICE (segfault) on error recovering in weird code


>Number:         10594
>Category:       c++
>Synopsis:       [3.3 regression] ICE (segfault) on error recovering in weird code
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          ice-on-illegal-code
>Submitter-Id:   net
>Arrival-Date:   Fri May 02 02:15:59 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Giovanni Bajo
>Release:        3.3 CVS 20030421
>Organization:
>Environment:
i686-pc-cygwin
>Description:
While playing a bit with c++/10108, I found this regression
on the 3.3 branch:

----------------------------------------------
struct Foo
{
    template <typename>
    struct Nested
    {};
};

class Bar
{
  Foo base ;

public:
  typedef Foo::Nested type;

  Bar() {}
  Bar(const Bar& x) 
      : base(x.base)
  {}
};
----------------------------------------------
pr10108.cpp:13: error: invalid use of template-name 'Foo::Nested' in a declarator
pr10108.cpp:13: error: syntax error before `;' token
pr10108.cpp:15: error: declaration does not declare anything
pr10108.cpp:15: error: missing ';' before right brace
pr10108.cpp:9: error: ISO C++ forbids declaration of `Bar' with no type
pr10108.cpp:17: error: ISO C++ forbids defining types within return type
pr10108.cpp:17: error: semicolon missing after declaration of `class Bar'
pr10108.cpp: In function `int Bar(const Bar&)':
pr10108.cpp:17: error: only constructors take base initializers
pr10108.cpp:10: error: `Foo Bar::base' is private
pr10108.cpp:17: error: within this context
pr10108.cpp:18: internal compiler error: Segmentation fault
Please submit a full bug report,

3.3 regression only (wrt 2.95), and does not show up in 3.4
(whose parser is much less aggressive and aborts
compilation earlier).

I rate this with the lowest priority and severity since it segfaults after several lines from the illegal code, and after decent error messages.
>How-To-Repeat:
Compile the above code.
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]