Title
constexpr constructors for non-literal types
Status
nad
Section
9.2.6 [dcl.constexpr]
Submitter
Daveed Vandevoorde

Created on 2015-12-21.00:00:00 last changed 74 months ago

Messages

Date: 2016-11-15.00:00:00

Rationale (November, 2016):

Such constructors can be useful for guaranteeing static initialization of namespace-scope objects.

Date: 2022-11-20.07:54:16

Given an example like:

  struct S {
    constexpr S(): i(42) {  }
    ~S();
    int i;
  };
  double x[S().i];  // Error

such a constexpr constructor is completely useless, but there doesn't appear to be anything in the current wording making it ill-formed. Should it be?

History
Date User Action Args
2018-02-27 00:00:00adminsetmessages: + msg6014
2018-02-27 00:00:00adminsetstatus: open -> nad
2015-12-21 00:00:00admincreate