- Mar 03, 2009
-
-
-
-
rdar://problem/6640991Steve Naroff authored
Also necessary to fix: <rdar://problem/6632061> [sema] non object types should not be allowed in @catch statements <rdar://problem/6252237> [sema] qualified id should be disallowed in @catch statements llvm-svn: 65964
-
rdar://problem/6497242Steve Naroff authored
Change Sema::DiagnosePropertyMismatch() to check for type compatibility (rather than type equivalence, which is too strict). llvm-svn: 65949
-
-
Eli Friedman authored
while I was at it. There are still a lot of diagnostics missing from this code, and it isn't completely correct for anything other than x86, but it should work correctly on x86 for valid cases. llvm-svn: 65935
-
Douglas Gregor authored
response to attempts to diagnose an "incomplete" type. This will force us to use DiagnoseIncompleteType more regularly (rather than looking at isIncompleteType), but that's also a good thing. Implicit instantiation is still very simplistic, and will create a new definition for the class template specialization (as it should) but it only actually instantiates the base classes and attaches those. Actually instantiating class members will follow. Also, instantiate the types of non-type template parameters before checking them, allowing, e.g., template<typename T, T Value> struct Constant; to work properly. llvm-svn: 65924
-
Fariborz Jahanian authored
llvm-svn: 65912
-
-
- Mar 02, 2009
-
-
Fariborz Jahanian authored
local or global variables in instance/class methods. llvm-svn: 65879
-
Fariborz Jahanian authored
llvm-svn: 65855
-
Fariborz Jahanian authored
in its extension. llvm-svn: 65854
-
Douglas Gregor authored
need them to evaluate redeclarations or call a function that hasn't already been declared. We now keep a DenseMap of these locally-scoped declarations so that they are not visible but can be quickly found, e.g., when we're looking for previous declarations or before we go ahead and implicitly declare a function that's being called. Fixes PR3672. llvm-svn: 65792
-
- Mar 01, 2009
-
-
rdar://problem/6248764Steve Naroff authored
Downgrade an error to a warning (for GCC compatibility). llvm-svn: 65779
-
Douglas Gregor authored
llvm-svn: 65777
-
Daniel Dunbar authored
llvm-svn: 65759
-
Chris Lattner authored
"This patch uses the new ObjCImplDecl class to merge Sema::ImplMethodsVsClassMethods and Sema::ImplCategoryMethodsVsIntfMethods methods. And now, when clang check a class implementation to find unimplemented methods, it also checks all methods from the class extensions (unnamed categories). There is also a test case to check this warning. This patch contains also a minor update for ObjCImplDecl . getNameAsCString and getNameAsString now returns an empty string instead of crashing for unnamed categories." Patch by Jean-Daniel Dupas! llvm-svn: 65744
-
Anders Carlsson authored
llvm-svn: 65737
-
- Feb 28, 2009
-
-
Anders Carlsson authored
Fix invalid VLAs/VMs in Sema::ActOnVariableDeclarator, so that the variable will have the right type by the time the initializer is checked. This ensures that code like int a[(int)(1.0 / 1.0) = { 1 } will work. Eli, please review. llvm-svn: 65725
-
Steve Naroff authored
llvm-svn: 65718
-
Chris Lattner authored
notice because it was a negative test with a fix suggested by Jean-Daniel Dupas. Convert the test from a negative to a positive test to catch stuff like this. llvm-svn: 65708
-
Steve Naroff authored
llvm-svn: 65695
-
rdar://problem/6451399Steve Naroff authored
- Move the 'LabelMap' from Sema to Scope. To avoid layering problems, the second element is now a 'StmtTy *', which makes the LabelMap a bit more verbose to deal with. - Add 'ActiveScope' to Sema. Managed by ActOnStartOfFunctionDef(), ObjCActOnStartOfMethodDef(), ActOnBlockStmtExpr(). - Changed ActOnLabelStmt(), ActOnGotoStmt(), ActOnAddrLabel(), and ActOnFinishFunctionBody() to use the new ActiveScope. - Added FIXME to workaround in ActOnFinishFunctionBody() (for dealing with C++ nested functions). llvm-svn: 65694
-
Eli Friedman authored
llvm-svn: 65680
-
Eli Friedman authored
As far as I know, this catches all cases of jumping into the scope of a variable with a variably modified type (excluding statement expressions) in C. This is missing some stuff we probably want to check (other kinds of variably modified declarations, statement expressions, indirect gotos/addresses of labels in a scope, ObjC @try/@finally, cleanup attribute), the diagnostics aren't very good, and it's not particularly efficient, but it's a decent start. This patch is a slightly modified version of the patch I attached to PR3259, and it fixes that bug. I was sort of planning on improving it, but I think it's okay as-is, especially since it looks like CodeGen doesn't have any use for this sort of data structure. The only significant change I can think of from the version I attached to PR3259 is that this version skips running the checking code when a function doesn't contain any labels. This patch doesn't cover case statements, which also need similar checking; I'm not sure how we should deal with that. Extending the goto checking to also check case statements wouldn't be too hard; it's just a matter of keeping track of the scope of the closest switch and checking that the scope of every case is the same as the scope of the switch. That said, it would likely be a performance hit to run this check on every function (it's an extra pass over the entire function), so we probably want some other solution. llvm-svn: 65678
-
Douglas Gregor authored
llvm-svn: 65671
-
Douglas Gregor authored
llvm-svn: 65669
-
Douglas Gregor authored
llvm-svn: 65668
-
Douglas Gregor authored
array types. Semantic checking for the construction of these types has been factored out of GetTypeForDeclarator and into separate subroutines (BuildPointerType, BuildReferenceType, BuildArrayType). We'll be doing the same thing for all other types (and declarations and expressions). As part of this, moved the type-instantiation functions into a class in an anonymous namespace. llvm-svn: 65663
-
- Feb 27, 2009
-
-
Fariborz Jahanian authored
llvm-svn: 65656
-
Chris Lattner authored
llvm-svn: 65653
-
Douglas Gregor authored
llvm-svn: 65652
-
Ted Kremenek authored
building nested member expressions. This location is used to determine the range of the entire expression, and the expression itself already has its location inherited from its Base. This fixes <rdar://problem/6629829>. llvm-svn: 65650
-
Douglas Gregor authored
stubs for those types we don't yet know how to instantiate (everything that isn't a template parameter!). We now instantiate default arguments for template type parameters when needed. This will be our testbed while I fill out the remaining type-instantiation logic. llvm-svn: 65649
-
Chris Lattner authored
in C89 mode. This makes it enabled by default instead of only enabled with -pedantic. Clang defaults to c99 mode, so people will see this more often than with GCC, but they can always use -std=c89 if they really want c89. llvm-svn: 65647
-
Ted Kremenek authored
set HasVAListArg to true when 'Y' is 0 (i.e., ignore the data arguments). This fixes <rdar://problem/6623513>. llvm-svn: 65642
-
Douglas Gregor authored
llvm-svn: 65641
-
Eli Friedman authored
normal expression, and change Evaluate and IRGen to evaluate it like a normal expression. This simplifies the code significantly, and fixes PR3396. llvm-svn: 65622
-
Eli Friedman authored
strict constant initializer checking. llvm-svn: 65612
-
Douglas Gregor authored
giving them rough classifications (normal types, never-canonical types, always-dependent types, abstract type representations) and making it far easier to make sure that we've hit all of the cases when decoding types. Switched some switch() statements on the type class over to using this mechanism, and filtering out those things we don't care about. For example, CodeGen should never see always-dependent or non-canonical types, while debug info generation should never see always-dependent types. More switch() statements on the type class need to be moved over to using this approach, so that we'll get warnings when we add a new type then fail to account for it somewhere in the compiler. As part of this, some types have been renamed: TypeOfExpr -> TypeOfExprType FunctionTypeProto -> FunctionProtoType FunctionTypeNoProto -> FunctionNoProtoType There shouldn't be any functionality change... llvm-svn: 65591
-