This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: ICE on invalid c++
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Mike Stump <mrs at apple dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 26 Dec 2005 17:18:31 -0800
- Subject: Re: ICE on invalid c++
- References: <BEAF7C26-6D40-49FD-92AC-4B3A1FFFAF22@apple.com>
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