[cfe-commits] [Patch] Add -Wmissing-variable-declarations

Ed Schouten ed at 80386.nl
Fri Oct 19 02:03:20 PDT 2012


Hi Eli,

Thanks again for taking your time to review my patch!

2012/10/19 Eli Friedman <eli.friedman at gmail.com>:
> +  if (var->isThisDeclarationADefinition() &&
> +      (var->getLinkage() == ExternalLinkage ||
> +      var->getLinkage() == UniqueExternalLinkage)) {
>
> We don't want to warn for code like the following, which is what
> UniqueExternalLinkage is used for:
>
> namespace {
>   int x;
> }

The problem is that if I don't check for UniqueExternalLinkage, it
won't trigger a warning for this code, even though it should:

struct {
  int foo;
} bar;

-- 
Ed Schouten <ed at 80386.nl>



More information about the cfe-commits mailing list