Bug 56486 - gcc 2.96-99 refuses to compile legal C++ code
Summary: gcc 2.96-99 refuses to compile legal C++ code
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gcc
Version: 7.1
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-11-19 20:06 UTC by Peter Klotz
Modified: 2007-04-18 16:38 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2001-11-19 20:06:45 UTC
Embargoed:


Attachments (Terms of Use)

Description Peter Klotz 2001-11-19 20:06:39 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)

Description of problem:


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


How reproducible:
Always

Steps to Reproduce:
1.Compile the program supplied under "Additional Information"
2.
3.
	

Additional info:

#include <string>

class A
{
public:
	template<typename T>
	void f(const std::string& x, const std::string& y, const T& z, 
const std::string& a="");
};


template<typename T>
void A::f(const std::string& x, const std::string& y, const T& z, const 
std::string& a)
{
}

template<>
void A::f<std::string>(const std::string& x, const std::string& y, const 
std::string& z, const std::string& a)
{
}

int main(void)
{
	A a;
	a.f("x","y",std::string("z"));
	return 0;
}

Comment 1 Jakub Jelinek 2001-11-19 20:19:15 UTC
libstdc++ v2 (found e.g. in gcc-2.95.x and gcc-2.96-RH) never claimed to be
100% ISO C++ 98 conforming, this is just one of the cases. With g++ 2.95.x
you'll get the same result.
If you want this to work, you can use gcc 3.0.x (e.g. found in RHL 7.2
gcc3* rpms).


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