This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/64842] Implicitly defined constructor isn't constexpr
- From: "simendsjo at simendsjo dot me" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 25 Feb 2015 08:42:55 +0000
- Subject: [Bug c++/64842] Implicitly defined constructor isn't constexpr
- Auto-submitted: auto-generated
- References: <bug-64842-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64842
--- Comment #2 from simendsjo at simendsjo dot me ---
(In reply to Ville Voutilainen from comment #1)
> The constructors for Point are constexpr, but since p2 is not, passing
> it as an argument for scale() means that the invocation of scale() will not
> yield a constant expression. If you change the declaration of p2 to
> be
> constexpr Point p2 {10,10};
> the code will work. Clang agrees with gcc.
Then there are a couple of possibilities:
1. The spec is wrong
2. Bjarne Stroustrup misinterprets the spec
3. gcc and clang has the same bug
You're saying that 2. holds. In that case, send a mail to Stroustrup so he can
correct his book "Programming: Principles and Practice using C++".