Bug 409251

Summary: g++ template handling bug
Product: [Fedora] Fedora Reporter: Przemyslaw Sowa <przemyslaw_sowa>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: low    
Version: 8   
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-12-06 13:07:56 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
The source code to reproduce the bug. none

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.