[cfe-dev] decl/expr ambiguity

Argiris Kirtzidis akyrtzi at gmail.com
Sun Aug 24 15:59:33 PDT 2008


Chris Lattner wrote:
> Okay, here's another crazy idea.  If you boil it down, my objections  
> to preparsing are basically:
>
> 1. the perf cost of having to do the prepare in *every* decl case.
> 2. [minor] the perf cost for qualified expr cases (std::cout << ...)
> 3. [minor] the maintenance cost of the second parser.
>   

1) This is not true, as I explain in this post:
http://lists.cs.uiuc.edu/pipermail/cfe-dev/2008-August/002625.html

2) This is not inherent to the preparser, even if there's a "tentatively 
parse decl then parse as expr" approach, we still prefer to do such 
resolutions once; This perf cost needs to be solved in either case.

3) Ummm.. it's [minor] right ? :-)

As a sidenote, the standard has provisions for the preparser approach, 
for example:
"If, during parsing, a name in a template parameter is bound differently 
than it would be bound during a trial parse, the program is ill-formed".


-Argiris



More information about the cfe-dev mailing list