From: Paolo Carlini Date: Thu, 9 Jul 2015 09:51:09 +0000 (+0000) Subject: re PR c++/65790 (compilation error : receive std::index_sequence) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a2fe398522e45afa586503e5b0a7c98e2352cd69;p=gcc.git re PR c++/65790 (compilation error : receive std::index_sequence) 2015-07-09 Paolo Carlini PR c++/65790 * g++.dg/cpp0x/vt-65790.C: New. From-SVN: r225607 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 49d6f2bf111..78dd30c74e2 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-07-09 Paolo Carlini + + PR c++/65790 + * g++.dg/cpp0x/vt-65790.C: New. + 2015-07-09 H.J. Lu PR target/66818 diff --git a/gcc/testsuite/g++.dg/cpp0x/vt-65790.C b/gcc/testsuite/g++.dg/cpp0x/vt-65790.C new file mode 100644 index 00000000000..477e9884304 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/vt-65790.C @@ -0,0 +1,35 @@ +// PR c++/65790 +// { dg-do compile { target c++11 } } + +extern "C" int printf(const char* ...); + +namespace std +{ + typedef decltype(sizeof(0)) size_t; + + template + struct integer_sequence + { + typedef _Tp value_type; + static constexpr size_t size() { return sizeof...(_Idx); } + }; + + template + using index_sequence = integer_sequence; +} + +void g(std::size_t a, std::size_t b, std::size_t c) +{ + printf("%zu, %zu, %zu\n", a, b, c); +} + +template +void f(std::index_sequence) +{ + g(Seq...); +} + +int main() +{ + f(std::index_sequence<0, 1, 2>()); +}