https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61753

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic
             Status|WAITING                     |NEW

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
This is not valid syntax for a constructor:

const Rule::Rule(const ExprPtr e) :
    expr(e)
{
}

The first const is ill-formed (and the second one is pointless, but harmless)

The error message could be better though, reduced:

class Rule {
  Rule(int e);
};

const Rule::Rule(int e) { }


test.cc:5:7: error: prototype for ‘Rule::Rule(int)’ does not match any in class
‘Rule’
 const Rule::Rule(int e) { }
       ^
test.cc:1:7: error: candidates are: Rule::Rule(const Rule&)
 class Rule {
       ^
test.cc:2:3: error:                 Rule::Rule(int)
   Rule(int e);
   ^


EDG has a better diagnostic:

"test.cc", line 5: error: return type may not be specified on a constructor

Reply via email to