Bug 57565 - variadic template and type inference failure
Summary: variadic template and type inference failure
Status: RESOLVED DUPLICATE of bug 66421
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.8.1
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2013-06-07 23:12 UTC by Anass Lasram
Modified: 2015-07-09 09:09 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2013-06-08 00:00:00


Attachments
sources, compiler details and command line (2.42 KB, application/x-zip-compressed)
2013-06-07 23:12 UTC, Anass Lasram
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Anass Lasram 2013-06-07 23:12:30 UTC
Created attachment 30279 [details]
sources, compiler details and command line

#include<iostream>
#include<tuple>

// #define DISABLE_COMPILE_ERROR

template<int... t>
void bug()
{
#ifndef DISABLE_COMPILE_ERROR
	auto tpl = std::make_tuple(t...); // doesn't compile but it should
#else
	std::tuple<int,int,int> tpl = std::make_tuple(t...);
#endif
    std::cout << std::get<0>(tpl) << " , " << std::get<1>(tpl) << " , " << std::get<2>(tpl) << std::endl;
}


int main()
{
	bug<10,20,30>();

	return 0;
}
Comment 1 Paolo Carlini 2013-06-07 23:42:22 UTC
Jon, can you help me reducing/triaging this? It's pretty bad, but I think I have seen something similar already.
Comment 2 Jonathan Wakely 2013-06-08 00:55:38 UTC
Weird ...

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

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

template<int... I>
void f()
{
  auto tp = make_tuple(I...);
};

int main()
{
  f<0, 1, 2>();
}


I can't recall anything similar right now.
Comment 3 Paolo Carlini 2013-06-08 08:00:27 UTC
Thanks Jon! Now that I see the problem reduced I agree it doesn't seem familiar, some fallback errors in the original testcase misled me. Pretty annoying bug anyway, let's add Jason in CC, in case he is ineterested in the short term or has cues.
Comment 4 Paolo Carlini 2015-07-09 09:09:43 UTC
Dup.

*** This bug has been marked as a duplicate of bug 66421 ***