This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/45923] constexpr diagnostics, more more
- From: "b.r.longbons at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 5 Jul 2011 03:53:12 +0000
- Subject: [Bug c++/45923] constexpr diagnostics, more more
- Auto-submitted: auto-generated
- References: <bug-45923-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45923
Ben Longbons <b.r.longbons at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |b.r.longbons at gmail dot
| |com
--- Comment #13 from Ben Longbons <b.r.longbons at gmail dot com> 2011-07-05 03:52:15 UTC ---
Also it seems the destructor must be defaulted. I thought (incorrectly) that
only constructors mattered, so tried:
protected:
~Base() {}
which yields for members:
error: enclosing class of '...' is not a literal type
and for nonmembers:
error: invalid return type 'Derived' of constexpr function '...'
but this works:
protected:
~Base() = default;
specifically, a 'literal type' requires literal members and bases and:
* a trivial default constructor or at least one constexpr constructor besides
the copy/move constructors (3.9 #10).
* a trivial destructor: non-virtual, non-deleted, non-user-provided (12.4 #3)