From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8787 invoked by alias); 8 May 2006 15:37:18 -0000 Received: (qmail 8757 invoked by uid 48); 8 May 2006 15:37:11 -0000 Date: Mon, 08 May 2006 15:37:00 -0000 Subject: [Bug c++/27496] New: ICE on broken templated friend X-Bugzilla-Reason: CC Message-ID: 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-05/txt/msg00784.txt.bz2 List-Id: The following invalid code snippet causes an ICE since GCC 3.0: =================================== template struct A { template friend class X; }; A<0> a; =================================== bug.cc:3: error: 'void' is not a valid type for a template constant parameter bug.cc: In instantiation of 'A<0>': bug.cc:6: instantiated from here bug.cc:3: error: 'void' is not a valid type for a template constant parameter bug.cc:3: internal compiler error: tree check: expected tree that contains 'decl common' structure, have 'error_mark' in tsubst_friend_class, at cp/pt.c:5443 Please submit a full bug report, [etc.] GCC 2.95.3 wrongly accepted the code. -- Summary: ICE on broken templated friend Product: gcc Version: 4.2.0 Status: UNCONFIRMED Keywords: ice-on-invalid-code, error-recovery, monitored Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: reichelt at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27496