summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
* Implement template instantiation for ClassTemplateSpecializationTypes,Douglas Gregor2009-03-094-117/+244
| | | | | | | | | | | | | | | | | | | | | | such as replacing 'T' in vector<T>. There are a few aspects to this: - Extend TemplateArgument to allow arbitrary expressions (an Expr*), and switch ClassTemplateSpecializationType to store TemplateArguments rather than it's own type-or-expression representation. - ClassTemplateSpecializationType can now store dependent types. In that case, the canonical type is another ClassTemplateSpecializationType (with default template arguments expanded) rather than a declaration (we don't build Decls for dependent types). - Split ActOnClassTemplateId into ActOnClassTemplateId (called from the parser) and CheckClassTemplateId (called from ActOnClassTemplateId and InstantiateType). They're smart enough to handle dependent types, now. llvm-svn: 66509
* Fix PR3766, a really nasty silent miscompilation case where we emittedChris Lattner2009-03-091-2/+11
| | | | | | | | | a warning and then threw away the AST. While I'm in there, tighten up the code to actually reject completely bogus cases (sending a message to a struct). We still allow sending a message to an int, which doesn't make sense but GCC allows it and is easy to support. llvm-svn: 66468
* Implement property '.' notation on Factory/Class objects. Parser changes ↵Steve Naroff2009-03-093-16/+83
| | | | | | | | aren't very pretty:-( This fixes <rdar://problem/6496506> Implement class setter/getter for properties. llvm-svn: 66465
* Revert r66423, which was not the right fix for this issue.Douglas Gregor2009-03-091-1/+3
| | | | llvm-svn: 66431
* Fix a little FIXME, thanks to SebastianDouglas Gregor2009-03-091-3/+1
| | | | llvm-svn: 66423
* Mark a non-type template parameter invalid if there was a problem with its typeDouglas Gregor2009-03-091-1/+3
| | | | llvm-svn: 66422
* Rename DiagnoseIncompleteType to RequireCompleteType, and update the ↵Douglas Gregor2009-03-097-29/+27
| | | | | | documentation to reflect the fact that we can instantiate templates here llvm-svn: 66421
* do not warn about -=/=- confusion with macros, thanks to rdogra for a testcase.Chris Lattner2009-03-091-1/+2
| | | | llvm-svn: 66416
* implement PR3753, warning about comparisons with a string literal.Chris Lattner2009-03-081-7/+24
| | | | llvm-svn: 66387
* Remove dead clause (we decided not to support protocol qualified 'Class').Steve Naroff2009-03-081-9/+0
| | | | llvm-svn: 66385
* Improvements to private method lookup.Steve Naroff2009-03-082-37/+62
| | | | | | Patch by Jean-Daniel Dupas. Thanks! llvm-svn: 66383
* refine the "use of unary operator that may be intended as compound ↵Chris Lattner2009-03-081-1/+5
| | | | | | | | | assignment (+=)" warning to only trigger when there is whitespace or something else after the + as suggested by Eli. llvm-svn: 66370
* Some struct/class mismatch fixes, to silence MSVC warnings.Sebastian Redl2009-03-071-2/+2
| | | | llvm-svn: 66335
* Don't discard increment/decrement on function pointers. It's kind of Eli Friedman2009-03-071-1/+0
| | | | | | | difficult to come up with a testcase because the code generation for this construct is broken. llvm-svn: 66325
* Revert my last couple patches until I can get them to not make the tests fail.Ted Kremenek2009-03-071-2/+2
| | | | llvm-svn: 66317
* Teach Diagnostic about Selector.Ted Kremenek2009-03-071-2/+2
| | | | llvm-svn: 66314
* Selector: (changes made after discussing this more with Steve Naroff)Ted Kremenek2009-03-071-2/+2
| | | | | | | | | | | - Make Selector::getAsIdentifierInfo() private. Using IdentifierInfo* in Selector is an implementation detail that clients shouldn't think about. - Modify diagnostic emission in Sema::ProcessPropertyDecl to not use Selector::getAsIdentifierInfo() (which could crash when IdentifierInfo* is null) and instead use Selector::getAsString(). - Tidy up Selector::getAsString() implementation. llvm-svn: 66313
* Downgrade complaints about the use of variable-sized types within aDouglas Gregor2009-03-061-11/+9
| | | | | | | struct to an extension warning to match the behavior of GNU C, which addresses the Sema part of PR3671. llvm-svn: 66308
* Use the 'declaration does not declare anything' error when we see an ↵Douglas Gregor2009-03-061-10/+9
| | | | | | anonymous struct/union declaration outside of a struct or union in C llvm-svn: 66303
* Implement GNU C semantics for K&R function definitions that follow aDouglas Gregor2009-03-061-2/+70
| | | | | | | | prototype of the same function, where the promoted parameter types in the K&R definition are not compatible with the types in the prototype. Fixes PR2821. llvm-svn: 66301
* Handle #pragma pack(0). I left this out of diagnostic because users shouldDaniel Dunbar2009-03-061-2/+4
| | | | | | | really use pack() instead. - <rdar://problem/6650243> clang warns about '#pragma pack(0)' llvm-svn: 66287
* Improve recovery from ill-formed scope specifiers. Fixes PR3670.Douglas Gregor2009-03-061-1/+5
| | | | llvm-svn: 66286
* Implement the GNU semantics for forward declarations of enum types inDouglas Gregor2009-03-061-4/+11
| | | | | | C and C++. Fixes PR3688. llvm-svn: 66282
* Add Parse/Sema support for weak_import attribute.Daniel Dunbar2009-03-061-0/+38
| | | | | | - Also, diagnose weak applied to types. llvm-svn: 66259
* add source range for type of super cast, giving something like:Chris Lattner2009-03-051-1/+1
| | | | | | | | SemaObjC/call-super-2.m:78:29: error: cannot cast 'super' (it isn't an expression) return [(Object <Func> *)super instance_func0]; ~~~~~~~~~~~~~~~~~^ llvm-svn: 66215
* more minor simplifications.Chris Lattner2009-03-051-7/+6
| | | | llvm-svn: 66214
* refactor C++ bitfield checking a bit (haha)Chris Lattner2009-03-052-58/+36
| | | | llvm-svn: 66213
* fix PR3607 and a fixme, by checking bitfield constraintsChris Lattner2009-03-053-14/+46
| | | | | | more consistently. llvm-svn: 66210
* Partial fix <rdar://problem/6301205> [irgen] dot-syntax on super isn't ↵Steve Naroff2009-03-051-2/+25
| | | | | | | | supported. Tweak Sema::ActOnMemberReferenceExpr() and Sema::ActOnDeclarationNameExpr() to handle "super." notation for Class methods. llvm-svn: 66185
* Tweak diag for <rdar://problem/5982579> [clang on xcode] (using ↵Steve Naroff2009-03-051-1/+4
| | | | | | arch=x86_64): synthesized property 'sdkPath' must either be named the same as a compatible ivar or must explicitly name an ivar. llvm-svn: 66162
* Fix <rdar://problem/6144382> [sema] gcc inconsistency w.r.t. forward ↵Steve Naroff2009-03-052-0/+31
| | | | | | protocol declarations. llvm-svn: 66161
* When parsing a function body, add it to the crash stack, giving us somethingChris Lattner2009-03-052-0/+14
| | | | | | | | | | | | | like: Stack dump: 0. t.c:5:10: in compound statement ('{}') 1. t.c:3:12: in compound statement ('{}') 2. t.c:3:12: parsing function body 'foo' 3. clang t.c Abort llvm-svn: 66118
* Removed an unfortunate cut and paste left-over.Fariborz Jahanian2009-03-041-2/+0
| | | | llvm-svn: 66099
* Implemented access check for ivars accessed insideFariborz Jahanian2009-03-042-17/+20
| | | | | | c-style functions declared inside objc @implementations. llvm-svn: 66087
* Partial fix for <rdar://problem/6645157> [clang on Xcode; regression]: ↵Steve Naroff2009-03-041-2/+16
| | | | | | | | | | error: instance variable 'someField' is private. A recent regression caused by http://llvm.org/viewvc/llvm-project?rev=65912&view=rev. This commit isn't fully baked. Nevertheless, it should cause Xcode to compile again. Will speak with Fariborz offline. llvm-svn: 66045
* Some refactoring of recent code. No functionality change.Fariborz Jahanian2009-03-042-23/+15
| | | | llvm-svn: 66041
* Fix a corner case of message lookup looking for class methods.Fariborz Jahanian2009-03-041-3/+21
| | | | | | | If all else failed, find the message in class's root's list of instacne methods! llvm-svn: 66040
* Finish up some fixes related to <rdar://problem/6497631> Message lookup is ↵Steve Naroff2009-03-043-15/+33
| | | | | | | | | sometimes different than gcc's. - Disallow casting 'super'. GCC allows this, however it doesn't make sense (super isn't an expression and the cast won't alter lookup/dispatch). - Tighten up lookup when messaging 'self'. llvm-svn: 66033
* Check that the return type for function definitions is complete.Eli Friedman2009-03-041-0/+8
| | | | llvm-svn: 66027
* Switch attributes to be allocated from the declcontext bump pointer just likeChris Lattner2009-03-043-55/+54
| | | | | | | decls. This reduces the number of calls to malloc on cocoa.h with pth and -disable-free from 15958 to 12444 times (down ~3500). llvm-svn: 66023
* add an a Attr::Destroy method and force clients to go through it. As part of Chris Lattner2009-03-041-6/+6
| | | | | | this, make DeclBase::Destroy destroy attributes instead of the DeclBase dtor. llvm-svn: 66020
* simplify Sema::AddInstanceMethodToGlobalPool, no functionality change.Chris Lattner2009-03-041-17/+15
| | | | llvm-svn: 66016
* Change Parser::ParseCaseStatement to use an iterative approach to parsingChris Lattner2009-03-042-11/+17
| | | | | | | | | | | | | | | | | | multiple sequential case statements instead of doing it with recursion. This fixes a problem where we run out of stack space parsing 100K directly nested cases. There are a couple other problems that prevent this from being useful in practice (right now the example only parses correctly with -disable-free and doesn't work with -emit-llvm), but this is a start. I'm not including a testcase because it is large and uninteresting for regtesting. Sebastian, I would appreciate it if you could scrutinize the smart pointer gymnastics I do. llvm-svn: 66011
* Change a warning to an error...Steve Naroff2009-03-031-1/+1
| | | | llvm-svn: 65978
* Implement an important missing warning when a selectorFariborz Jahanian2009-03-031-7/+19
| | | | | | | is searched for in the global pool. It already uncovered a clang bug in message selection. llvm-svn: 65974
* Fix <rdar://problem/5982579> [clang on xcode] (using arch=x86_64): ↵Steve Naroff2009-03-031-1/+2
| | | | | | synthesized property 'sdkPath' must either be named the same as a compatible ivar or must explicitly name an ivar. llvm-svn: 65973
* Fix <rdar://problem/6252237> [sema] qualified id should be disallowed in ↵Steve Naroff2009-03-031-3/+8
| | | | | | @catch statements. llvm-svn: 65969
* Fix <rdar://problem/6632061> [sema] non object types should not be allowed ↵Steve Naroff2009-03-031-2/+8
| | | | | | in @catch statements. llvm-svn: 65968
* Fix <rdar://problem/6640991> Exception handling executes wrong clause ↵Steve Naroff2009-03-032-3/+3
| | | | | | | | | | | (Daniel, please verify). 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
* Fix <rdar://problem/6497242> Inherited overridden protocol declared objects ↵Steve Naroff2009-03-032-6/+15
| | | | | | | | don't work. Change Sema::DiagnosePropertyMismatch() to check for type compatibility (rather than type equivalence, which is too strict). llvm-svn: 65949
OpenPOWER on IntegriCloud