[cfe-commits] r65385 - in /cfe/trunk: lib/Sema/Sema.h lib/Sema/SemaDecl.cpp test/Sema/var-redecl.c test/Sema/vla.c

Douglas Gregor dgregor at apple.com
Tue Feb 24 13:24:42 PST 2009


On Feb 24, 2009, at 1:02 PM, Eli Friedman wrote:

> On Tue, Feb 24, 2009 at 11:23 AM, Douglas Gregor <dgregor at apple.com>  
> wrote:
>> +  // FIXME: We don't do this in C++ because, although we would like
>> +  // to get the extra checking that this operation implies,
>> +  // the declaration itself is not visible according to C++'s rules.
>
> It isn't visible according to C's rules either... what exactly is the
> issue here?


The issue is that we want to diagnose cases where there are  
incompatible declarations even when those declarations aren't  
necessarily visible. For example:

   void g(int) {
	int f(int); // #1
   }

   float f(float); // #2: ill-formed, even though #1 isn't visible

Also:

   void g(int) {
     int f(int, int); // #1
   }

   void g2(int i) {
     f(i); // #1: the implicit declaration of "f" would be  
incompatible with the declaration of f in g.
   }

Both GCC and EDG diagnose these problems, and (now) so do we.

	- Doug



More information about the cfe-commits mailing list