This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/63924] Constexpr constructible expression "is not constexpr" when used in a template non-type argument
- From: "mouchtaris at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 19 Nov 2014 22:15:06 +0000
- Subject: [Bug c++/63924] Constexpr constructible expression "is not constexpr" when used in a template non-type argument
- Auto-submitted: auto-generated
- References: <bug-63924-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63924
--- Comment #5 from Nikos <mouchtaris at gmail dot com> ---
I am sorry, it is missing from the original test case, but
noop<
require_costexpr< size0(ar) >,
require_constexp< size1(ar) >
>();
compiles fine. If the issue about test's trivial byte-wise copy construction is
true, shouldn't it cause the degenaration of size0's and size1's constexpr-ness
and cause errors in their usage as template arguments?
Standard-addressing issues are mentioned in the stackoverflow link I have
provided. Specifically, the following comes from Â12.8 [class.copy]/p13:
If the implicitly-defined constructor would satisfy the requirements of a
constexpr constructor (7.1.5), the implicitly-defined constructor is
constexpr.
I don't see why an implicit constructor copying a literal padding byte is not a
constexpr constructor. The compiler, I assume, is capable of keeping track of
padding bytes as literals at compile time. Or am I mistaken?
Thanks a lot for the fix, and thanks a lot for such a quick response.