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]

c++/9447: using Base<T>::member does not work


>Number:         9447
>Category:       c++
>Synopsis:       using Base<T>::member does not work
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Mon Jan 27 08:56:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Richard Guenther
>Release:        [3.4 regression] g++-3.4 (GCC) 3.4 20030124 (experimental)
>Organization:
>Environment:
ix86-linux
>Description:
In the following testcase, member i of Foo is not brought to scope by the using declaration, instead g++ reports:

bellatrix:~/src/tests$ g++-3.4 -c using3.cpp -Wall
using3.cpp: In member function `void Bar<T>::foo()':
using3.cpp:11: error: `i' has not been declared

this works with both 3.2 and 3.3 (in fact, they dont care if I omit the using declaration, too, but in whole this is a regression).

template <class T>
struct Foo {
        int i;
};

template <class T>
struct Bar : public Foo<T> {
        using Foo<T>::i;
        void foo()
        {
                i = 0;
        }
};

int main()
{
        Bar<int> bar;
        bar.foo();
        return 0;
}
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


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