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

             Bug #: 56489
           Summary: [C++11] Member type lookup fails on dependent
                    using-declarations
    Classification: Unclassified
           Product: gcc
           Version: 4.7.2
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: c++
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: hhhppps...@hotmail.com


Created attachment 29558
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29558
test case

If a type alias to a template dependent type is introduced by a
using-declaration, gcc fails to lookup its member types. The following code can
be used to test this behavior:

template <typename T>
struct A
{
    using type = void;

    constexpr static int value = 0;
};

template <typename T>
void func()
{
    typedef A<T> A_typedef;
    using   A_using = A<T>;

    int value_typedef = A_typedef::value;
    int value_using   = A_using  ::value;

    using type_typedef = typename A_typedef::type;
    using type_using   = typename A_using  ::type;
}

template void func<int>();

When compiled with gcc 4.7.2 (-c -std=gnu++11), it gives an error message:

test.cpp: In instantiation of ‘void func() [with T = int]’:
test.cpp:22:25:   required from here
test.cpp:19:50: error: no type named ‘type’ in ‘using A_using = struct A<T>’

Reply via email to