This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/85097] ICE in double parameter pack
- From: "boldizsar.palotas at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 27 Mar 2018 15:45:19 +0000
- Subject: [Bug c++/85097] ICE in double parameter pack
- Auto-submitted: auto-generated
- References: <bug-85097-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85097
--- Comment #2 from Boldizsár Palotás <boldizsar.palotas at gmail dot com> ---
More specifically, this seems to fail on every version of GCC that supports
"-std=c++11" -- since 4.7.1, based on testing on Compiler Explorer. It is
compiled (I assume correctly) by Clang and MSVC.
A simplified version of the code is below:
template <typename A, typename B>
struct X {};
template <typename... TOuter> // Note the omitted bogus typename parameter
struct S
{
template <typename... TInner>
void function(X<TOuter, TInner>...)
{ }
};
void test_case() {
S<int> s; // Note the omitted void parameter
s.function(X<int, short>());
}
This seems to fail in the same situations, but instead of ICE, it gives the
following error:
<source>: In function 'void test_case()':
<source>:14:31: error: no matching function for call to
'S<int>::function(X<int, short int>)'
s.function(X<int, short>());
^
<source>:8:10: note: candidate: template<class ... TInner> void
S<TOuter>::function(X<TOuter, TInner>...) [with TInner = {TInner ...}; TOuter =
{int}]
void function(X<TOuter, TInner>...)
^~~~~~~~
<source>:8:10: note: template argument deduction/substitution failed:
<source>:14:31: note: mismatched types 'TInner' and 'short int'
s.function(X<int, short>());
^
The examples above can be checked here: https://godbolt.org/g/dNkjSk
This could be a duplicate of #84796 or #77731