constexpr void function rejected
问题 I have this very simple function which won't compile. constexpr void func() { } The error I'm getting is: error: invalid return type ' void ' of constexpr function ' constexpr void func() ' constexpr void func() In C++14, void is a literal type [§3.9/10]: A type is a literal type if it is: void; or a scalar type; or a reference type; or an array of literal type; or a class type (Clause 9) that has all of the following properties: it has a trivial destructor, it is an aggregate type (8.5.1) or