re PR c++/83856 (ICE in tsubst_copy;)

PR c++/83856
	* g++.dg/cpp1y/lambda-generic-83856.C: New test.

From-SVN: r266711
This commit is contained in:
Marek Polacek 2018-12-01 21:09:31 +00:00 committed by Marek Polacek
parent 96c35892be
commit 8fc1ef712d
2 changed files with 33 additions and 0 deletions

View file

@ -34,6 +34,9 @@
* g++.dg/template/typedef6.C: Adjust dg-error.
* g++.dg/template/typename3.C: Only expect error in c++17_down.
PR c++/83856
* g++.dg/cpp1y/lambda-generic-83856.C: New test.
2018-12-01 Jeff Law <law@redhat.com>
* gcc.dg/predict-22.c: Update expected output.

View file

@ -0,0 +1,30 @@
// PR c++/83856
// { dg-do compile { target c++14 } }
namespace std {
template <typename _Tp> _Tp declval();
template <class _E> class initializer_list {
_E *_M_len;
public:
unsigned long size;
_E begin();
};
template <typename, unsigned> struct array { void operator[](long); };
} // namespace std
template <class> struct simd {
static int size();
template <class F> simd(F, decltype(std::declval<F>()(0)) * = nullptr) {}
};
template <class V, class... F>
void test_tuples(std::initializer_list<std::array<float, 1>> data,
F... fun_pack) {
auto it = data.begin();
const int remaining = V::size();
[](...) {}((fun_pack([&](auto) { it[remaining]; }), 0)...);
}
void f() {
test_tuples<simd<float>>({}, [](simd<float>) {});
}