This makes me think that we should make hasExternalStorage perform this check...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71962
91177308-0d34-0410-b5e6-
96231b3b80d8
QualType InitType = Type;
if (const ArrayType *Array = Context.getAsArrayType(Type))
InitType = Array->getElementType();
- if (!Var->hasExternalStorage() && InitType->isRecordType()) {
+ if ((!Var->hasExternalStorage() && !Var->isExternC(Context)) &&
+ InitType->isRecordType()) {
CXXRecordDecl *RD =
cast<CXXRecordDecl>(InitType->getAsRecordType()->getDecl());
CXXConstructorDecl *Constructor = 0;
extern "C" const int bar;
extern "C" int const bar;
+
+// <rdar://problem/6895431>
+extern "C" struct bar d;
+extern struct bar e;