Title
Incorrect example after constexpr changes
Status
cd4
Section
7.7 [expr.const]
Submitter
Daniel Krügler

Created on 2013-05-15.00:00:00 last changed 95 months ago

Messages

Date: 2013-09-15.00:00:00

Notes from the September, 2013 meeting:

This issue is being handled editorially and is being placed in "review" status to ensure that the change has been made.

Date: 2013-05-15.00:00:00

The example in 7.7 [expr.const] paragraph 6,

  struct A {
    constexpr A(int i) : val(i) { }
    constexpr operator int() { return val; }
    constexpr operator long() { return 43; }
  private:
    int val;
  };
  template<int> struct X { };
  constexpr A a = 42;
  X<a> x;               // OK: unique conversion to int
  int ary[a];           // error: ambiguous conversion

is no longer correct now that constexpr does not imply const for member functions, since the conversion functions cannot be invoked for the constant a.

History
Date User Action Args
2017-02-06 00:00:00adminsetstatus: drwp -> cd4
2015-04-13 00:00:00adminsetstatus: review -> drwp
2013-10-14 00:00:00adminsetmessages: + msg4609
2013-10-14 00:00:00adminsetstatus: open -> review
2013-05-15 00:00:00admincreate