[cfe-dev] Hello

Chris Lattner clattner at apple.com
Mon Oct 6 10:49:14 PDT 2008

On Oct 6, 2008, at 5:42 AM, Doug Gregor wrote:

> On Sun, Oct 5, 2008 at 7:37 PM, Argiris Kirtzidis  
> <akyrtzi at gmail.com> wrote:
>> About the example:
>> typedef int foo;
>> namespace abc { foo bar(); }
>> foo::abc::bar()
>> {
>> // ...
>> }
>> Are you suggesting that we should have identical behavior as gcc (not
>> emitting an error) ?
>> This doesn't seem so important, particularly considering that it is
>> going to be explicitly stated that an error is necessary.
>> We already have minor incompatibilities with gcc, like the scoping of
>> the 'condition' declarations in selection/iteration statements and  
>> some
>> cases of declaration/expression ambiguity resolution.
> If the standard says we're required to produce an error, then we
> should produce an error. We don't want to get into the game of trying
> to parse ill-formed code that other compilers happen to parse.
> Building a standards-conforming C++ front end is hard enough as it is
> :)

FWIW, I also agree here: In terms of core C++ support (name  
resolution, templates, etc), clang should aim to be as conformant as  
possible.  Accepting broken code is more more important for C than C+ 
+.  That said, I think it will be important for the C++ front-end to  
accept some of the grossness that comes from the common subset of C  
and C++ (e.g. "extended" integer constant expressions, etc), and we'll  
probably end up supporting the GNU C++ extensions as well someday.

For better or worse, C++ programmers are much more used to having to  
tweak their code when updating compilers than C programmers, and there  
are many more 'dusty decks' of C programs out there.


More information about the cfe-dev mailing list