This is the mail archive of the gcc-bugs@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]

Re: c++/9384: [3.4 Regression] ICE in validate_nonmember_using_decl, at cp/decl2.c:4152


The ICEs in the 3.3 branch and mainline are completely unrelated
as the follwoing reduced testcases show.

The bug on mainline can be triggered with the following line of code:

----------------------snip here----------------------
namespace A { using ::B; }
----------------------snip here----------------------

Compiling this with mainline I get

PR9384A.cc:1: internal compiler error: in validate_nonmember_using_decl, at 
   cp/decl2.c:4152

This is a regression on mainline.


The bug on the 3.3 branch can be triggered with the following testcase:

----------------------snip here--------------------------------------
template <typename T> struct A
{
    A(int);
};

template <typename T> A<T>::A(int i __attribute__ ((__unused__)) ) {}
----------------------snip here--------------------------------------

The code causes a compiler crash since gcc 3.0 (which is changed to a
"confused by earlier errors, ..." message in release versions):

PR9384B.cc:6: error: parse error before `__attribute__'
PR9384B.cc:6: internal compiler error: in poplevel, at cp/decl.c:1283

(gcc 2.95.3 rejects the code and mainline accepts it).

I don't know where you have to place the attribute, but placing it in
front of "int i" makes the code compile, writing just "int" without "i"
and attribute "__unused__" should have the same effect, right?

Given that this is just an error recovery problem and that there's an
easy workaround, I don't think that this will be fixed on 3.3 branch.

Regards,
Volker

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9384



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