digitalmars.D - Missing code from DMD's 2.003 front-end? (ping Walter)
- Ary Manzana <ary esperanto.org.ar> Jul 30 2007
- Walter Bright <newshound1 digitalmars.com> Jul 30 2007
- Ary Manzana <ary esperanto.org.ar> Jul 31 2007
- James Dennett <jdennett acm.org> Jul 31 2007
Hi, While porting DMD's 2.003 source code to Java I realized that in parse.c a new method "parseType" with several overloads was added. However, the only definition of it is the following: Type *Parser::parseType(Identifier **pident, TemplateParameters **tpl); However, in the source code there are several invocations like this: - parseType(&ai) - parseType() This definitely doesn't compile, unless there is some "implicit argument" feature in C++ I don't know. This is blocking my current effort to bring D2 functionality into Descent. Regards, Ary
Jul 30 2007
Ary Manzana wrote:Hi, While porting DMD's 2.003 source code to Java I realized that in parse.c a new method "parseType" with several overloads was added. However, the only definition of it is the following: Type *Parser::parseType(Identifier **pident, TemplateParameters **tpl);
That's incorrect. In parse.h, the correct definition gives =NULL as the default value for each parameter.
Jul 30 2007
Walter Bright wrote:Ary Manzana wrote:Hi, While porting DMD's 2.003 source code to Java I realized that in parse.c a new method "parseType" with several overloads was added. However, the only definition of it is the following: Type *Parser::parseType(Identifier **pident, TemplateParameters **tpl);
That's incorrect. In parse.h, the correct definition gives =NULL as the default value for each parameter.
Thanks! I didn't know you could assign default parameters in the declaration and not repeat them in the definition.
Jul 31 2007
Ary Manzana wrote:Walter Bright wrote:Ary Manzana wrote:Hi, While porting DMD's 2.003 source code to Java I realized that in parse.c a new method "parseType" with several overloads was added. However, the only definition of it is the following: Type *Parser::parseType(Identifier **pident, TemplateParameters **tpl);
That's incorrect. In parse.h, the correct definition gives =NULL as the default value for each parameter.
Thanks! I didn't know you could assign default parameters in the declaration and not repeat them in the definition.
Indeed, repeating them would be an error in C++ (though a later declaration can add additional default argument values). -- James
Jul 31 2007








James Dennett <jdennett acm.org>