[Bug c++/45923] constexpr diagnostics, more more

b.r.longbons at gmail dot com gcc-bugzilla@gcc.gnu.org
Tue Jul 5 03:53:00 GMT 2011


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)



More information about the Gcc-bugs mailing list