This is the mail archive of the gcc-patches@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: ICE on invalid c++


Mike Stump wrote:
> template <class T> class C {
>     typedef T* int;
> };
> 
> ICEs due to the fact the DECL_NAME is 0.  With the below patch, we  now
> get:
> 
> t1.cc:2: error: expected unqualified-id before 'int'
> t1.cc:2: error: expected ';' before 'int'
> 
> and no ICE.  Now, the only question is, do we want to put the check 
> here, or, should we catch this sooner?

Sooner.  We should not be anywhere near build_template_decl; when we
issue the error "expected unqualified-id before 'int'" we know this
declarator is invalid; we should then skip to the end of the declarator
and completely ignore the declaration.

-- 
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com
(650) 331-3385 x713


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