This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/81525] [7/8 Regression] Invalid codegen with constexpr variable template
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 24 Jul 2017 08:42:48 +0000
- Subject: [Bug c++/81525] [7/8 Regression] Invalid codegen with constexpr variable template
- Auto-submitted: auto-generated
- References: <bug-81525-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81525
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2017-07-24
CC| |jakub at gcc dot gnu.org,
| |jason at gcc dot gnu.org
Target Milestone|--- |7.2
Summary|[7 Regression] Invalid |[7/8 Regression] Invalid
|codegen with constexpr |codegen with constexpr
|variable template |variable template
Ever confirmed|0 |1
--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Started with r239267.
Simplified testcase:
template <int i> struct A { constexpr operator int () const { return i; } };
template <int i> constexpr A<i> a{};
template <typename F> void foo (F f) { f (A<0>{}); }
template <typename T>
void bar (T) { constexpr auto N = a<1>; auto f = [&] (auto i) { static_assert
(static_cast<int>(N) == 1, ""); }; foo (f); }
int main () { bar (0); }