https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66421

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |rejects-valid
            Version|unknown                     |4.9.2

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Reduced:

template<typename... T> struct tuple { };

template<typename... T> tuple<T...> make_tuple(T&&...) { return {}; }

template <typename... Params>
void foo(Params... params) {
    auto t = make_tuple((int)params...);
}

template <typename... Params>
void bar(Params... params) {
  tuple<decltype((int)params)...> t = make_tuple((int)params...);
}

int main() {
    foo(1,2,3); // Fails, clang++ compiles it
    bar(1,2,3); // Compiles correctly
}


t.cc: In instantiation of ‘void foo(Params ...) [with Params = {int, int,
int}]’:
t.cc:16:14:   required from here
t.cc:7:39: error: conversion from ‘tuple<int, int, int>’ to non-scalar type
‘tuple<int>’ requested
     auto t = make_tuple((int)params...);
                                        ^

Reply via email to