aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-02-28 23:31:06 +0000
committerAnders Carlsson <andersca@mac.com>2009-02-28 23:31:06 +0000
commit0db28c59266808b9bf4fb72c2db80ce9f2948b74 (patch)
tree2b6d8c432e58e42165f8866487f63ed3c1987a15 /lib/Sema/SemaDecl.cpp
parent1a7acfa0de7364b24599be4329d7ee2944540428 (diff)
Whoops, actually remove the VLA/VM check in FinalizeDeclaratorGroup.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65737 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp36
1 files changed, 0 insertions, 36 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 76794e571d..8764cd9d77 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -2256,42 +2256,6 @@ Sema::DeclTy *Sema::FinalizeDeclaratorGroup(Scope *S, DeclTy *group) {
continue;
QualType T = IDecl->getType();
- bool isIllegalVLA = T->isVariableArrayType() && IDecl->hasGlobalStorage();
- bool isIllegalVM = T->isVariablyModifiedType() && IDecl->hasLinkage();
- if (isIllegalVLA || isIllegalVM) {
- bool SizeIsNegative;
- QualType FixedTy =
- TryToFixInvalidVariablyModifiedType(T, Context, SizeIsNegative);
- if (!FixedTy.isNull()) {
- Diag(IDecl->getLocation(), diag::warn_illegal_constant_array_size);
- IDecl->setType(FixedTy);
- } else if (T->isVariableArrayType()) {
- IDecl->setInvalidDecl();
-
- const VariableArrayType *VAT = Context.getAsVariableArrayType(T);
- // FIXME: This won't give the correct result for
- // int a[10][n];
- SourceRange SizeRange = VAT->getSizeExpr()->getSourceRange();
-
- if (IDecl->isFileVarDecl())
- Diag(IDecl->getLocation(), diag::err_vla_decl_in_file_scope)
- << SizeRange;
- else if (IDecl->getStorageClass() == VarDecl::Static)
- Diag(IDecl->getLocation(), diag::err_vla_decl_has_static_storage)
- << SizeRange;
- else
- Diag(IDecl->getLocation(), diag::err_vla_decl_has_extern_linkage)
- << SizeRange;
- } else {
- IDecl->setInvalidDecl();
-
- if (IDecl->isFileVarDecl())
- Diag(IDecl->getLocation(), diag::err_vm_decl_in_file_scope);
- else
- Diag(IDecl->getLocation(), diag::err_vm_decl_has_extern_linkage);
- }
- }
-
// Block scope. C99 6.7p7: If an identifier for an object is declared with
// no linkage (C99 6.2.2p6), the type for the object shall be complete...
if (IDecl->isBlockVarDecl() &&