This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/68495] Error when expanding nontype variadic argument in trailing return type
- From: "sneves at dei dot uc.pt" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 23 Nov 2015 08:53:17 +0000
- Subject: [Bug c++/68495] Error when expanding nontype variadic argument in trailing return type
- Auto-submitted: auto-generated
- References: <bug-68495-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68495
--- Comment #1 from Samuel Neves <sneves at dei dot uc.pt> ---
Minimal example can be further reduced to
template<int> struct int_seq {};
constexpr struct {
constexpr int operator()(int x) const { return x + 1; }
} f1 {};
template<typename F, int A>
auto f2(F f, int_seq<A>) -> int_seq<f(A)> {
return {};
}
int main() {
f2(f1, int_seq<0>{});
}
This suggests that the issue is with GCC not recognizing that `f::operator()`
is constexpr; this information is seemingly lost somewhere along the way.