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

             Bug #: 51593
           Summary: alias templates fail in dependent contexts requiring
                    ::template
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: pub...@alisdairm.net


The following code is sufficient to demonstrate:

template<typename T>
struct wrap {
template<typename U>
using type = U;
};

template<typename T>
struct test {
using type = wrap<T>::template type<T>;
};

I get the following errors from a gcc built around Dec 10, 2011:

main.cpp:9:10: error: expected nested-name-specifier before 'type'
main.cpp:9:10: error: using-declaration for non-member at class scope
main.cpp:9:15: error: expected ';' before '=' token
main.cpp:9:15: error: expected unqualified-id before '=' token

This idiom seems important for supporting C++11 allocators, which supply just
such a dependent alias.

Version info from my GCC build (running on Mac OS/X 10.7.2)
Using built-in specs.
COLLECT_GCC=g++-mp-4.7
COLLECT_LTO_WRAPPER=/opt/local/libexec/gcc/x86_64-apple-darwin11/4.7.0/lto-wrapper
Target: x86_64-apple-darwin11
Configured with: ../gcc-4.7-20111210/configure --prefix=/opt/local
--build=x86_64-apple-darwin11 --enable-languages=c,c++,objc,obj-c++
--libdir=/opt/local/lib/gcc47 --includedir=/opt/local/include/gcc47
--infodir=/opt/local/share/info --mandir=/opt/local/share/man
--datarootdir=/opt/local/share/gcc-4.7 --with-local-prefix=/opt/local
--with-system-zlib --disable-nls --program-suffix=-mp-4.7
--with-gxx-include-dir=/opt/local/include/gcc47/c++/ --with-gmp=/opt/local
--with-mpfr=/opt/local --with-mpc=/opt/local --enable-stage1-checking
--disable-multilib
Thread model: posix
gcc version 4.7.0 20111210 (experimental) (GCC)

Reply via email to