[llvm-bugs] [Bug 37157] New: Alias template produces seemingly bogus "template template argument has different template parameters" error

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Apr 17 16:20:47 PDT 2018


https://bugs.llvm.org/show_bug.cgi?id=37157

            Bug ID: 37157
           Summary: Alias template produces seemingly bogus "template
                    template argument has different template parameters"
                    error
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: arthur.j.odwyer at gmail.com
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org

I (and also GCC 7.0-and-later) claim that this program is legal C++.

    template<template<class> class X> struct A {};
    template<template<class...> class Y> using B = A<Y>;
    template<class> struct S;
    B<S> b;

Clang, on the other hand, bails out at line 2:

prog.cc:2:50: error: template template argument has different template
parameters than its corresponding template template parameter
template<template<class...> class Y> using B = A<Y>;
                                                 ^
prog.cc:2:19: note: template type parameter pack does not match template type
parameter in template argument
template<template<class...> class Y> using B = A<Y>;
                  ^
prog.cc:1:19: note: previous template type parameter declared here
template<template<class> class X> struct A {};
                  ^

Clang becomes happy if I change it from 'using B = A<Y>' to 'struct B {}', and
then sad again if I change it to 'struct B : A<Y> {}'.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180417/c535b351/attachment-0001.html>


More information about the llvm-bugs mailing list