http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52126

             Bug #: 52126
           Summary: compilation error
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: tmmikolajc...@gmail.com


I encountered a compilation error when compiling the following code:

template<typename T>
class A
{
public:
    void foo() {};

    class B : private A<T>
    {
    public:
        typedef A<T> inherited;
        using inherited::foo;
    };
};

The code seems to be valid. Compilation output (the gcc_47_error.cpp file is
attached):
$ g++ --version
g++ (GCC) 4.7.0 20120205 (experimental)
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ g++ gcc_47_error.cpp
gcc_47_error.cpp:12:26: error: no members matching ‘A<T>::B::inherited::foo’ in
‘A<T>::B::inherited’

It compiles fine with gcc 4.6.2 and clang.
I'm using gcc built manually based on revision 183914.

My OS: Arch Linux:
$ uname -a
Linux alligator 3.2.2-1-ARCH #1 SMP PREEMPT Thu Jan 26 08:28:27 UTC 2012 i686
Intel(R) Pentium(R) 4 CPU 2.40GHz GenuineIntel GNU/Linux

Reply via email to