Bug 409251 - g++ template handling bug
Summary: g++ template handling bug
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: 8
Hardware: i686
OS: Linux
low
high
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-12-03 20:12 UTC by Przemyslaw Sowa
Modified: 2007-12-06 13:07 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-12-06 13:07:56 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
The source code to reproduce the bug. (325 bytes, text/plain)
2007-12-03 20:12 UTC, Przemyslaw Sowa
no flags Details

Description Przemyslaw Sowa 2007-12-03 20:12:30 UTC
Description of problem:


Version-Release number of selected component (if applicable):


How reproducible:
Try to compile the attached file.

Steps to Reproduce:
1. g++ -o bug g++_bug.cpp
  
Actual results:
g++_bug.cpp: In constructor ‘Template<T>::Template() [with T = int]’:
g++_bug.cpp:5:   instantiated from ‘int Template<int>::member’
g++_bug.cpp:5:   instantiated from ‘Template<T>::Template() [with T = int]’
g++_bug.cpp:18:   instantiated from here
g++_bug.cpp:5: internal compiler error: in instantiate_decl, at cp/pt.c:11947


Expected results:
Compiled code.

Additional info:
g++ (GCC) 4.1.2 20070925 (Red Hat 4.1.2-33)

Comment 1 Przemyslaw Sowa 2007-12-03 20:12:30 UTC
Created attachment 276091 [details]
The source code to reproduce the bug.

Comment 2 Jakub Jelinek 2007-12-06 13:07:56 UTC
This is invalid code, and g++ 4.3 emits proper diagnostics.
rh409251.C:14: error: template arguments to ‘Template<int>::member’ do not match 
original template ‘Template<T>::member’
rh409251.C:14: note: use template<> for an explicit specialization

For 4.1/4.2 this is too low priority bug, so marking as fixed with NEXTRELEASE,
as F9 is going to use F9 soon.


Note You need to log in before you can comment on or make changes to this bug.