]> granicus.if.org Git - clang/commit
Final phase of array cleanup (for now), removing a FIXME from yesterday.
authorSteve Naroff <snaroff@apple.com>
Thu, 30 Aug 2007 22:35:45 +0000 (22:35 +0000)
committerSteve Naroff <snaroff@apple.com>
Thu, 30 Aug 2007 22:35:45 +0000 (22:35 +0000)
commit42471f8bc6c1179a54941fac3c483ec1bd319436
tree209f6116c7af627cac0c3e29a0069f22f3243831
parent535bb20b6e252809bc17cc59b5d71b5e5e549e70
Final phase of array cleanup (for now), removing a FIXME from yesterday.

Moved several array constraints checks from Sema::VerifyConstantArrayType() to
Sema::GetTypeForDeclarator(). VerifyConstantArrayType() is now very simple, and
could be removed eventually.

Now, we get the following (correct) messages for BlockVarDecls:-)

[dylan:~/llvm/tools/clang] admin% ../../Debug/bin/clang x.c -pedantic
x.c:4:20: error: size of array has non-integer type 'float'
  int size_not_int[f];
                   ^
x.c:5:21: error: array size is negative
  int negative_size[1-2];
                    ^~~
x.c:6:17: warning: zero size arrays are an extension
  int zero_size[0];
                ^
3 diagnostics generated.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41624 91177308-0d34-0410-b5e6-96231b3b80d8
Sema/SemaDecl.cpp
Sema/SemaType.cpp
include/clang/Basic/DiagnosticKinds.def
test/Sema/array-constraint.c