This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/34453] New: Scope of nested template classes


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]