Bug 65050 - gcc 3.1-1 accesses private typedef
gcc 3.1-1 accesses private typedef
Status: CLOSED CURRENTRELEASE
Product: Red Hat Raw Hide
Classification: Retired
Component: gcc (Show other bugs)
1.0
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-05-16 15:21 EDT by Peter Klotz
Modified: 2007-04-18 12:42 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-10-02 16:11:00 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Peter Klotz 2002-05-16 15:21:05 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0rc2)
Gecko/20020510

Description of problem:
Since the typedef in class Base is private, Base<T>::TT should be inaccessible
from class Derived.

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


How reproducible:
Always

Steps to Reproduce:
1.g++ -W -Wall main.cpp -o main
2../main
3.
	

Actual Results:  Compiles and runs.

Expected Results:  Should not compile.

Additional info:

#include <list>
#include <string>

template<typename T>
class Base
{
    typedef T TT;
};

template<typename T>
class Derived : public Base<T>
{
public:
    typedef typename Base<T>::TT TT;
    void f() { std::list<TT> l; }
};

int main(void)
{
    Derived<std::string>().f();
    return 0;
}
Comment 1 Peter Klotz 2003-10-19 07:23:15 EDT
You can close this bug report since gcc 3.3.x in Fedora handles the above code 
correctly.
Comment 2 Richard Henderson 2004-10-02 16:11:00 EDT
Indeed, fixed in gcc 3.3.

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