Summary: CTFE call of non-static member function allowed inside
           Product: D
           Version: 1.045
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Keywords: accepts-invalid
          Severity: normal
          Priority: P2
         Component: DMD


The code

struct Struct {
   Struct method() {
      return *this;

template Template() {
   const CONST_STRUCT = Struct().method(); // A: no error
alias Template!() foo;

const CONST_STRUCT2 = Struct().method(); // B: error

correctly produces an error for line B "non-constant expression
(Struct()).method()" (the CTFE spec says: "4. the function may not be a
non-static member, i.e. it may not have a this pointer"), but doesn't for line

Please either make both lines work and update the spec, or make A an error.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to