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++/52126] New: compilation error


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: unassigned@gcc.gnu.org
        ReportedBy: tmmikolajczyk@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


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