This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/61660] static_assert triggering when it should not
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 30 Jun 2014 16:16:42 +0000
- Subject: [Bug c++/61660] static_assert triggering when it should not
- Auto-submitted: auto-generated
- References: <bug-61660-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61660
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |INVALID
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Udo Steinberg from comment #0)
> In the attached test case, for each compile-time constant value x,
x is not a compile-time constant, it's a run-time parameter of the function.
> only one
> static_assert in the switch statement should be checked.
Why? All four are in the body of the function template and all four are
compiled for every instantiation, so all four are checked on every
instantiation
A 'switch' is a run-time condition.
> Looks like all four
> of them are checked every time.
That's exactly what's supposed to happen.