summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/array-constraint.c
Commit message (Collapse)AuthorAgeFilesLines
* Removed Sema::VerifyConstantArrayType(). With the new ↵Steve Naroff2007-08-311-0/+10
| | | | | | | | | | | | | | | | | Array/ConstantArray/VariableArray nodes, this routine was causing more trouble than it was worth. Anders/Chris noticed that it could return an error code without emiting a diagnostic (which results in an silent invalid decl, which should *never* happen). In addition, this routine didn't work well for typedefs and field decls. Lastly, it didn't consider that initializers aren't in place yet. Added Type::getAsConstantArrayType(), Type::getAsVariableArrayType(), Type::getAsVariablyModifiedType(), and Type::isVariablyModifiedType(); Modified Sema::ParseDeclarator() and Sema::ParseField() to use the new predicates. Also added a FIXME for the initializer omission. Also added a missing test for "static" @ file scope. llvm-svn: 41647
* Final phase of array cleanup (for now), removing a FIXME from yesterday.Steve Naroff2007-08-301-0/+8
| | | | | | | | | | | | | | | | | | | | | | 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. llvm-svn: 41624
* Move the "invalid decl" idiom up to Decl (where we have some bits to steal:-)Steve Naroff2007-08-281-0/+6
| | | | | | | | Converted ParmVarDecl, FileVarDecl, BlockVarDecl, and Sema::ParseIdentifierExpr() to use the idiom. Updated array-constraint.c to make sure we no longer get "undeclared identifier" errors:-) llvm-svn: 41552
* Fix bogus warnings (noticed by Chris) with array-constraints.c.Steve Naroff2007-08-261-1/+17
| | | | | | | | | Remove bogus type conversions in Sema::GetTypeForDeclarator(). This commit only deals with the array types (DeclaratorCheck::Array), though the rest of this routine should be reviewed. Given the complexity of C declarators, I don't want to change the entire routine now (will discuss with Chris tomorrow). llvm-svn: 41443
* steve's recent changes fixed this bogus warning.Chris Lattner2007-08-261-1/+1
| | | | llvm-svn: 41432
* oops, this is the real fix.Chris Lattner2007-08-021-1/+1
| | | | llvm-svn: 40766
* update testChris Lattner2007-08-021-1/+1
| | | | llvm-svn: 40765
* Fix a crasher that Neil reported: Sema::GetTypeForDeclarator should never Chris Lattner2007-07-191-0/+11
return a null type. If there is an error parsing the type, pick a new type for error recovery purposes. llvm-svn: 40029
OpenPOWER on IntegriCloud