This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/64842] Implicitly defined constructor isn't constexpr


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++".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]