From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12080 invoked by alias); 18 Apr 2006 10:43:59 -0000 Received: (qmail 12063 invoked by uid 48); 18 Apr 2006 10:43:57 -0000 Date: Tue, 18 Apr 2006 10:43:00 -0000 Message-ID: <20060418104357.12062.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c++/27102] [4.0/4.1/4.2 regression] ICE with invalid class name in function template In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "reichelt at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2006-04/txt/msg01408.txt.bz2 List-Id: ------- Comment #4 from reichelt at gcc dot gnu dot org 2006-04-18 10:43 ------- Hi Mark, I was just testing the following btw.: =================================================================== --- gcc/gcc/cp/parser.c (revision 112814) +++ gcc/gcc/cp/parser.c (working copy) @@ -10930,6 +10930,12 @@ cp_parser_init_declarator (cp_parser* parser, we compute it now. */ scope = get_scope_of_declarator (declarator); + if (scope && TYPE_P (scope) && !CLASS_TYPE_P (scope)) + { + error ("type %qT is not allowed in declaration", scope); + return error_mark_node; + } + /* If we're allowing GNU extensions, look for an asm-specification and attributes. */ if (cp_parser_allow_gnu_extensions_p (parser)) =================================================================== This should also fix PR 11471. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27102