Commit a98b7321 by Marek Polacek Committed by Marek Polacek

re PR c++/85827 (false positive for -Wunused-but-set-variable because of constexpr-if)

PR c++/85827
g++.dg/cpp1z/constexpr-if29.C: New test.

From-SVN: r274587
parent 639f51ba
2019-08-16 Marek Polacek <polacek@redhat.com>
PR c++/85827
* g++.dg/cpp1z/constexpr-if29.C: New test.
2019-08-15 Jason Merrill <jason@redhat.com>
PR c++/90393 - ICE with thow in ?:
......
// PR c++/85827
// { dg-do compile { target c++17 } }
// { dg-options "-Wunused-variable -Wunused-parameter" }
template <int N> int f()
{
constexpr bool _1 = N == 1;
constexpr bool _2 = N == 2;
constexpr bool _3 = N == 3;
if constexpr (_1) {
return 5;
} else if constexpr (_2) {
return 1;
} else if constexpr (_3) {
return 7;
}
}
int a() {
return f<1>();
}
int b() {
return f<2>();
}
int c() {
return f<3>();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment