public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/21151] New: ICE when compiling c++ PCH of class definition within template function.
@ 2005-04-21 14:25 simonjcan at yahoo dot co dot uk
  2005-04-21 14:37 ` [Bug c++/21151] [4.0/4.1 Regression] " pinskia at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: simonjcan at yahoo dot co dot uk @ 2005-04-21 14:25 UTC (permalink / raw)
  To: gcc-bugs

Place the following code in a header file 'code.h' and compile a precompiled  
header with 'g++-4.0 -c code.h':   
template<typename T> void func()   
{   
	class object   
	{   
	public:   
		object() {} // Any function declaration produces an ICE.   
	};   
}   
   
code.h: In function 'void func()':   
code.h:6: internal compiler error: Segmentation fault   
Please submit a full bug report,   
with preprocessed source if appropriate.   
See <URL:http://gcc.gnu.org/bugs.html> for instructions.   
   
Compiling the code via 'g++-4.0 -c code.cpp' with 'code.cpp' containing the 
single line:   
#include "code.h"   
   
succeeds without error.    
gcc-3.4.3 does not exhibit this bug.   
  
I'm using 4.0.0 20050410 (prerelease) with Debian unstable on an Athlon-XP,  
gcc was configured as:   
../gcc-4.0.0-20050410/configure --enable-languages=c,c++   
--prefix=/usr/local/compilers --program-suffix=-4.0

-- 
           Summary: ICE when compiling c++ PCH of class definition within
                    template function.
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: simonjcan at yahoo dot co dot uk
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21151


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/21151] [4.0/4.1 Regression] ICE when compiling c++ PCH of class definition within template function.
  2005-04-21 14:25 [Bug c++/21151] New: ICE when compiling c++ PCH of class definition within template function simonjcan at yahoo dot co dot uk
@ 2005-04-21 14:37 ` pinskia at gcc dot gnu dot org
  2005-06-01 13:47 ` nathan at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-04-21 14:37 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-04-21 14:37 -------
Confirmed, here is the backtrace:
#0  write_name (decl=0x41dc1380, ignore_local_scope=1) at /Users/pinskia/src/alias/gcc/gcc/cp/
mangle.c:1440
#1  0x000fe888 in write_encoding (decl=0x41dc1380) at /Users/pinskia/src/alias/gcc/gcc/cp/
mangle.c:740
#2  0x000ff1a4 in write_mangled_name (decl=0x680000, top_level=1 '\001') at /Users/pinskia/src/
alias/gcc/gcc/cp/mangle.c:710
#3  0x001005f8 in mangle_decl (decl=0x41dc1380) at /Users/pinskia/src/alias/gcc/gcc/cp/mangle.c:
2526
#4  0x000b117c in cp_parser_member_declaration (parser=0x680000) at /Users/pinskia/src/alias/
gcc/gcc/cp/parser.c:13333
#5  0x000a19d0 in cp_parser_type_specifier (parser=0x41dbe8c0, flags=CP_PARSER_FLAGS_NONE, 
decl_specs=0xbffff490, is_declaration=1 '\001', declares_class_or_enum=0xbffff40c, 
is_cv_qualifier=0x41dbce00 "A??") at /Users/pinskia/src/alias/gcc/gcc/cp/parser.c:13017
#6  0x000a2db0 in cp_parser_decl_specifier_seq (parser=0x0, flags=CP_PARSER_FLAGS_NONE, 
decl_specs=0x41dbce00, declares_class_or_enum=0xbffff40c) at /Users/pinskia/src/alias/gcc/gcc/cp/
parser.c:7285
#7  0x000af2ec in cp_parser_simple_declaration (parser=0x41dbe8c0, 
function_definition_allowed_p=0 '\0') at /Users/pinskia/src/alias/gcc/gcc/cp/parser.c:6981
#8  0x0009ea04 in cp_parser_block_declaration (parser=0x41dbe8c0, statement_p=0 '\0') at /Users/
pinskia/src/alias/gcc/gcc/cp/parser.c:6942
#9  0x0009f8bc in cp_parser_statement (parser=0x41dbe8c0, in_statement_expr=0x0) at /Users/
pinskia/src/alias/gcc/gcc/cp/parser.c:6644
#10 0x000a0474 in cp_parser_statement_seq_opt (parser=0x41dbe8c0, in_statement_expr=0x0) at /
Users/pinskia/src/alias/gcc/gcc/cp/parser.c:6178
#11 0x000a05a4 in cp_parser_compound_statement (parser=0x41dbf220, 
in_statement_expr=0x41dbe8c0, in_try=152 '\230') at /Users/pinskia/src/alias/gcc/gcc/cp/parser.c:
6151
#12 0x000a0684 in cp_parser_ctor_initializer_opt_and_function_body (parser=0x41dbe8c0) at /Users/
pinskia/src/alias/gcc/gcc/cp/parser.c:12059
#13 0x000a0c40 in cp_parser_function_definition_after_declarator (parser=0x41dbe8c0, inline_p=0 
'\0') at /Users/pinskia/src/alias/gcc/gcc/cp/parser.c:14924
#14 0x000af168 in cp_parser_init_declarator (parser=0x41dbe8c0, decl_specifiers=0xbffff880, 
function_definition_allowed_p=1 '\001', member_p=0 '\0', declares_class_or_enum=7348368, 
function_definition_p=0xbffff878 "\001g\202l") at /Users/pinskia/src/alias/gcc/gcc/cp/parser.c:
14869
#15 0x000afc4c in cp_parser_single_declaration (parser=0x430176a4, member_p=128 '\200', 
friend_p=0x1 <Address 0x1 out of bounds>) at /Users/pinskia/src/alias/gcc/gcc/cp/parser.c:15112


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |ice-on-valid-code
   Last reconfirmed|0000-00-00 00:00:00         |2005-04-21 14:37:25
               date|                            |
            Summary|ICE when compiling c++ PCH  |[4.0/4.1 Regression] ICE
                   |of class definition within  |when compiling c++ PCH of
                   |template function.          |class definition within
                   |                            |template function.
   Target Milestone|---                         |4.0.1


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21151


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/21151] [4.0/4.1 Regression] ICE when compiling c++ PCH of class definition within template function.
  2005-04-21 14:25 [Bug c++/21151] New: ICE when compiling c++ PCH of class definition within template function simonjcan at yahoo dot co dot uk
  2005-04-21 14:37 ` [Bug c++/21151] [4.0/4.1 Regression] " pinskia at gcc dot gnu dot org
@ 2005-06-01 13:47 ` nathan at gcc dot gnu dot org
  2005-06-02  8:54 ` cvs-commit at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: nathan at gcc dot gnu dot org @ 2005-06-01 13:47 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |nathan at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2005-04-21 14:37:25         |2005-06-01 13:47:36
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21151


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/21151] [4.0/4.1 Regression] ICE when compiling c++ PCH of class definition within template function.
  2005-04-21 14:25 [Bug c++/21151] New: ICE when compiling c++ PCH of class definition within template function simonjcan at yahoo dot co dot uk
  2005-04-21 14:37 ` [Bug c++/21151] [4.0/4.1 Regression] " pinskia at gcc dot gnu dot org
  2005-06-01 13:47 ` nathan at gcc dot gnu dot org
@ 2005-06-02  8:54 ` cvs-commit at gcc dot gnu dot org
  2005-06-02  8:58 ` nathan at gcc dot gnu dot org
  2005-06-02  9:00 ` cvs-commit at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-06-02  8:54 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-06-02 08:54 -------
Subject: Bug 21151

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	nathan@gcc.gnu.org	2005-06-02 08:53:48

Modified files:
	gcc/cp         : ChangeLog name-lookup.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/pch: local-1.C local-1.Hs 

Log message:
	cp:
	PR c++/21151
	* name-lookup.c (pushtag): Push local class even in a template.
	testsuite:
	PR c++/21151
	* g++.dg/pch/local-1.C: New.
	* g++.dg/pch/local-1.Hs: New.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4767&r2=1.4768
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/name-lookup.c.diff?cvsroot=gcc&r1=1.121&r2=1.122
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.5575&r2=1.5576
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/pch/local-1.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/pch/local-1.Hs.diff?cvsroot=gcc&r1=NONE&r2=1.1



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21151


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/21151] [4.0/4.1 Regression] ICE when compiling c++ PCH of class definition within template function.
  2005-04-21 14:25 [Bug c++/21151] New: ICE when compiling c++ PCH of class definition within template function simonjcan at yahoo dot co dot uk
                   ` (2 preceding siblings ...)
  2005-06-02  8:54 ` cvs-commit at gcc dot gnu dot org
@ 2005-06-02  8:58 ` nathan at gcc dot gnu dot org
  2005-06-02  9:00 ` cvs-commit at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: nathan at gcc dot gnu dot org @ 2005-06-02  8:58 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From nathan at gcc dot gnu dot org  2005-06-02 08:58 -------
2005-06-02  Nathan Sidwell  <nathan@codesourcery.com>

	PR c++/21151
	* name-lookup.c (pushtag): Push local class even in a template.


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21151


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/21151] [4.0/4.1 Regression] ICE when compiling c++ PCH of class definition within template function.
  2005-04-21 14:25 [Bug c++/21151] New: ICE when compiling c++ PCH of class definition within template function simonjcan at yahoo dot co dot uk
                   ` (3 preceding siblings ...)
  2005-06-02  8:58 ` nathan at gcc dot gnu dot org
@ 2005-06-02  9:00 ` cvs-commit at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-06-02  9:00 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-06-02 08:59 -------
Subject: Bug 21151

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-4_0-branch
Changes by:	nathan@gcc.gnu.org	2005-06-02 08:59:25

Modified files:
	gcc/cp         : ChangeLog name-lookup.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/pch: local-1.C local-1.Hs 

Log message:
	cp:
	PR c++/21151
	* name-lookup.c (pushtag): Push local class even in a template.
	testsuite:
	PR c++/21151
	* g++.dg/pch/local-1.C: New.
	* g++.dg/pch/local-1.Hs: New.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.4648.2.52&r2=1.4648.2.53
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/name-lookup.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.109.4.4&r2=1.109.4.5
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.5084.2.219&r2=1.5084.2.220
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/pch/local-1.C.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/pch/local-1.Hs.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.2.1



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21151


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2005-06-02  9:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-21 14:25 [Bug c++/21151] New: ICE when compiling c++ PCH of class definition within template function simonjcan at yahoo dot co dot uk
2005-04-21 14:37 ` [Bug c++/21151] [4.0/4.1 Regression] " pinskia at gcc dot gnu dot org
2005-06-01 13:47 ` nathan at gcc dot gnu dot org
2005-06-02  8:54 ` cvs-commit at gcc dot gnu dot org
2005-06-02  8:58 ` nathan at gcc dot gnu dot org
2005-06-02  9:00 ` cvs-commit at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).