(For example needed to parse system header inputscope.h, which first has
an extern "C" selectany IID and then later an extern "C" declaration of that
same IID.)
llvm-svn: 235174
if (hasInit())
return Definition;
- if (hasAttr<AliasAttr>() || hasAttr<SelectAnyAttr>())
+ if (hasAttr<AliasAttr>() ||
+ (hasAttr<SelectAnyAttr>() && !getAttr<SelectAnyAttr>()->isInherited()))
return Definition;
// A variable template specialization (other than a static data member
struct SomeStruct {};
extern const __declspec(selectany) SomeStruct some_struct; // expected-warning {{default initialization of an object of const type 'const SomeStruct' without a user-provided default constructor is a Microsoft extension}}
+// It should be possible to redeclare variables that were defined
+// __declspec(selectany) previously.
+extern const SomeStruct some_struct;
+
// Without selectany, this should stay an error.
const SomeStruct some_struct2; // expected-error {{default initialization of an object of const type 'const SomeStruct' without a user-provided default constructor}}