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

             Bug #: 57222
           Summary: Template alias not working in argument of template
                    class template method
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: florian.conr...@gmail.com


When I declare a template method of a template class whose argument type is
specified by a template alias, I get a compile error. With version 4.7.3 it
compiles. If I change the template class to a class, it compiles. If I replace
the template alias by the actual type (here Templ<bool>), it compiles.

Code:

template <template <typename T> class Templ>
using Bool = Templ<bool>;

template <typename T>
class Foo {
private:
public:
    template<template<typename U> class Templ>
    void method(Bool<Templ> boolTempl);
};

template <typename T>
template <template <typename U> class Templ>
void Foo<T>::method(Bool<Templ> boolTempl) {
}

int main() {
    Foo<char> foo;
    return 0;
}

Compiler Output:

g++ templTest12.C -o templTest12 -std=c++11
templTest12.C: In substitution of `template<template<class T> class Templ>
using Bool = Templ<bool> [with Templ = Templ]':
templTest12.C:17:6:   required from `class Foo<char>'
templTest12.C:30:12:   required from here
templTest12.C:2:25: error: `template<class U> class Templ' is not a template
 using Bool = Templ<bool>;

Compiler Specs:

g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro
4.8.0-2ubuntu2~12.04.2' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs
--enable-languages=c,c++,go,fortran,objc,obj-c++ --prefix=/usr
--program-suffix=-4.8 --enable-shared --enable-linker-build-id
--libexecdir=/usr/lib --without-included-gettext --enable-threads=posix
--with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls
--with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug
--enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin
--with-system-zlib --enable-objc-gc --enable-multiarch --disable-werror
--with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64
--with-tune=generic --enable-checking=release --build=x86_64-linux-gnu
--host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.8.0 (Ubuntu/Linaro 4.8.0-2ubuntu2~12.04.2)

System Info:

uname -a
Linux ip-10-245-218-142 3.2.0-39-virtual #62-Ubuntu SMP Thu Feb 28 00:48:27 UTC
2013 x86_64 x86_64 x86_64 GNU/Linux

Reply via email to