Today we discovered the confusing behavior of declaring a C ++ 11 alias. Here is an example:
template<typename T> struct Q { typedef T t; }; template<typename T> void foo(Q<T> q) { using q_t = Q<T>;
ISO 14882 (C ++ 11) says that these two declarations should have the same semantics (p. 145).
However, if we have q_t declared using ', this example does not compile using GCC 4.7.2 (Debian Wheezy) and GCC 4.7.3 (Ubuntu 13.04), but replacing the' using 'statement with the typedef statement makes it compiled.
Is this a mistake in the GCC or are we just misunderstood the standards?
source share