[Bug c++/56489] New: [C++11] Member type lookup fails on dependent using-declarations
hhhpppsss1 at hotmail dot com
gcc-bugzilla@gcc.gnu.org
Fri Mar 1 06:17:00 GMT 2013
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: unassigned@gcc.gnu.org
ReportedBy: hhhpppsss1@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>’
More information about the Gcc-bugs
mailing list