This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/54020] [c++0x] incorrectly accepted constexpr functions
- 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: Thu, 19 Jul 2012 06:40:41 +0000
- Subject: [Bug c++/54020] [c++0x] incorrectly accepted constexpr functions
- Auto-submitted: auto-generated
- References: <bug-54020-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54020
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-07-19 06:40:41 UTC ---
... the program is ill-formed; no diagnostic required.
^^^^^^^^^^^^^^^^^^^^^^^
GCC doesn't immediately see that the first operand of ?: is zero or non-zero in
that function, so assumes it could be either zero or non-zero and doesn't
diagnose, you get diagnostics only when you are actually using the function in
some constexpr var initializer or other context where a constant expression is
required.