On Tue, Jun 18, 2013 at 5:47 AM, Rafael Espíndola <
[email protected]> wrote:

> > I also badgered the committee back in February when this last came up,
> > and no consensus for a language change appeared. I'm trying
> > rebadgering :)
>
> Until then I think we should conform to what other compilers do and is
> less surprising to the users. This is not the same case as, for
> example, dependent bases, where the standard was not implemented by
> gcc and msvc at the time but was a better model than what those
> compilers implemented. Examples like:
>
> extern "C" {
>   static void foo(int x);
>   static void foo() {
>   }
>   void foo(int x) {
>   }
> }
>
> show are not adding value by being pedantically correct.
>
> I am not sure I understand your suggestion about
> LocallyScopedExternCDecls. Consider a variant of the testcase above
> with just the last two functions. The foo(int) will be the fist extern
> C and overload resolution will decide we have an overload. We would
> have to walk the lookup results again to find foo().
>

Suppose overloading completely ignores whether a declaration is extern "C",
and suppose you have a hashtable which returns the extern "C" decl for a
given identifier.  After you conclude foo(int) overloads foo(), you look in
the hashtable and say "oops, there was already a declaration with that
name".  (I haven't really thought through whether this is a good idea.)

-Eli
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to