[patch] Fix pr16247

Rafael EspĂ­ndola rafael.espindola at gmail.com
Tue Jun 18 05:47:09 PDT 2013


> 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().

Cheers,
Rafael



More information about the cfe-commits mailing list