[LLVMbugs] [Bug 18401] An ICE with a variadic alias template aliasing another variadic alias template

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Jan 8 18:25:22 PST 2014


http://llvm.org/bugs/show_bug.cgi?id=18401

Richard Smith <richard-llvm at metafoo.co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |richard-llvm at metafoo.co.uk
         Resolution|---                         |FIXED

--- Comment #5 from Richard Smith <richard-llvm at metafoo.co.uk> ---
See core issue 1430. The current direction there is that this code should be
ill-formed, because the RHS of 'baz' can't be reduced to a type that doesn't
involve an alias template. But we don't have precise core rules for that yet.

I've fixed this for now by disallowing a pack expansion to be used in the
argument list of an alias template, except in the case where it matches the
final parameter of the alias template, and that parameter is also a pack, until
we get a concrete answer from core. Your example gives:

tmp.cpp:3:56: error: pack expansion used as argument for non-pack parameter of
alias template
template<typename T, typename... Args> using baz = bar<Args..., T>;
                                                       ^~~~~~~
tmp.cpp:2:19: note: template parameter is declared here
template<typename T, typename... Args> using bar = foo<T, Args...>;
                  ^

Fixed in r198833.

We may need to revise this later, since we can now reject templates containing
alias template expansions where expanding the outer template removes the
problem from the inner template. But this'll do for now.

-- 
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/20140109/a99ab445/attachment.html>


More information about the llvm-bugs mailing list