Fix another case where the extern-ness of extern "C" wasn't being captured.

This makes me think that we should make hasExternalStorage perform this check...

llvm-svn: 71962
This commit is contained in:
Anders Carlsson 2009-05-16 22:05:23 +00:00
parent 5b53576fe4
commit 7bf3c4227d
2 changed files with 6 additions and 1 deletions

View File

@ -2703,7 +2703,8 @@ void Sema::ActOnUninitializedDecl(DeclPtrTy dcl) {
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;

View File

@ -21,3 +21,7 @@ extern "C" int foo;
extern "C" const int bar;
extern "C" int const bar;
// <rdar://problem/6895431>
extern "C" struct bar d;
extern struct bar e;