[Bug c++/34453] New: Scope of nested template classes
rombust at hotmail dot co dot uk
gcc-bugzilla@gcc.gnu.org
Thu Dec 13 14:34:00 GMT 2007
The following test code (stripped down):
template<typename CharType>
class CLASS_A
{
public:
int value;
};
template<typename CharType>
class CLASS_B : public CLASS_A<CharType>
{
public:
int GetValue() { return value; }
};
Gives the following error:
test.cpp: In member function Âint CLASS_B<CharType>::GetValue()Â:
test.cpp:16: error: Âvalue was not declared in this scope
If i change the GetValue() line to:
int GetValue() { return CLASS_A<CharType>::value; }
It compiles.
(This works in Microsoft Visual Studio)
--
Summary: Scope of nested template classes
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: rombust at hotmail dot co dot uk
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34453
More information about the Gcc-bugs
mailing list