PR tree-optimization/86415 - strlen() not folded for substrings within constant arrays
[official-gcc.git] / gcc / testsuite / g++.dg / cpp1y / constexpr-loop5.C
blob02f372d98887ed7b100133238daea6427a197667
1 // PR c++/68530
2 // { dg-do compile { target c++14 } }
4 struct thing {
5     void foo() {}
6 };
8 template<typename>
9 constexpr int count()
11     auto item = thing {};
12     for(; (item.foo(), false);); // { dg-error "foo" }
13     return 0;
16 int main()
18     static_assert( count<int>() == 0, "" ); // { dg-error "" }