Sema::FinalizeDeclaratorGroup()...make sure we emit an diagnostic for tentative definitions with incomplete types. Touch up all test cases that are effected.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46152 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Sema/SemaDecl.cpp b/Sema/SemaDecl.cpp
index 9e6dbfe..c2c66a2 100644
--- a/Sema/SemaDecl.cpp
+++ b/Sema/SemaDecl.cpp
@@ -853,7 +853,8 @@
// storage-class specifier or with the storage-class specifier "static",
// constitutes a tentative definition. Note: A tentative definition with
// external linkage is valid (C99 6.2.2p5).
- if (FVD && !FVD->getInit() && FVD->getStorageClass() == VarDecl::Static) {
+ if (FVD && !FVD->getInit() && (FVD->getStorageClass() == VarDecl::Static ||
+ FVD->getStorageClass() == VarDecl::None)) {
// C99 6.9.2p3: If the declaration of an identifier for an object is
// a tentative definition and has internal linkage (C99 6.2.2p3), the
// declared type shall not be an incomplete type.