* decl.c (make_typename_type): s/parameters/arguments/.
[official-gcc.git] / gcc / testsuite / g++.dg / cpp0x / constexpr-69315.C
blobcf32938ecc06dece5749efaaca23e9a2ab527dd6
1 // PR c++/69315
2 // { dg-do compile { target c++11 } }
3 // { dg-options "-O2" }
5 // Template instantiation and evaluation for folding within
6 // finish_function may call finish_function recursively.
7 // Make sure we don't reject or delay that sort of recursion.
9 template <bool> struct Iter;
11 struct Arg {
12   Iter<true> begin();
13   Iter<true> end();
16 template <bool> struct Iter {
17   int operator*();
18   Iter operator++();
19   template <bool C1, bool C2> friend constexpr bool operator==(Iter<C1>, Iter<C2>);
20   template <bool C1, bool C2> friend constexpr bool operator!=(Iter<C1>, Iter<C2>);
23 void func(Arg a) {
24   for (auto ch : a) {
25     a.begin() == a.end();
26   }
29 template <bool C1, bool C2> constexpr bool operator==(Iter<C1>, Iter<C2>) {
30   return true;
33 template <bool C1, bool C2> constexpr bool operator!=(Iter<C1> a, Iter<C2> b) {
34   return a == b;