gcc/testsuite/g++.dg/opt/pr94441.C
raw| 1 | // PR debug/94441 |
| 2 | // { dg-do compile } |
| 3 | // { dg-options "-O3 -fno-forward-propagate --param=max-cse-insns=0 -flive-range-shrinkage -std=c++17 -fcompare-debug" } |
| 4 | |
| 5 | template <class,class> struct Same; |
| 6 | template <class T> struct Same<T,T> {}; |
| 7 | |
| 8 | auto f() |
| 9 | { |
| 10 | if constexpr (sizeof(int)==3) |
| 11 | return 42; |
| 12 | else |
| 13 | return 42L; |
| 14 | } |
| 15 | |
| 16 | Same<decltype(f()), long> s; |