summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
...
* Rework parsing of pseudo-destructor expressions and explicitDouglas Gregor2010-02-243-4/+164
| | | | | | | | | | | | | | | | | | | | | | | | | | | | destructor calls, e.g., p->T::~T We now detect when the member access that we've parsed, e.g., p-> or x. may be a pseudo-destructor expression, either because the type of p or x is a scalar or because it is dependent (and, therefore, may become a scalar at template instantiation time). We then parse the pseudo-destructor grammar specifically: ::[opt] nested-name-specifier[opt] type-name :: ∼ type-name and hand those results to a new action, ActOnPseudoDestructorExpr, which will cope with both dependent member accesses of destructors and with pseudo-destructor expressions. This commit affects the parsing of pseudo-destructors, only; the semantic actions still go through the semantic actions for member access expressions. That will change soon. llvm-svn: 97045
* When we encounter a function-specific attribute in a declaration specifier,Charles Davis2010-02-241-5/+9
| | | | | | | apply it only to the function itself, and never to the return type. Fixes part of PR6408. llvm-svn: 97015
* More Sema check for ivars in class continuation.Fariborz Jahanian2010-02-233-15/+32
| | | | llvm-svn: 97002
* Add support for the weakref attribute. We still produce "alias weak" as ↵Rafael Espindola2010-02-231-10/+93
| | | | | | llvm-gcc does, but are more strict on what uses of weakref we accept. llvm-svn: 96992
* Fix another crash on invalid code. In this case, handle ObjC categories ↵Ted Kremenek2010-02-231-10/+19
| | | | | | | | (with no names) that refer to an undefined class. llvm-svn: 96976
* Don't assert on compound assignment operators that operate in FP types whenJohn McCall2010-02-231-3/+15
| | | | | | the result is integral. Fixes <rdar://problem/7676608>. llvm-svn: 96970
* When comparing two calling conventions after redeclaring a function, compareCharles Davis2010-02-231-1/+2
| | | | | | | the canonical calling conventions instead of comparing the raw calling conventions directly. Fixes PR6361. llvm-svn: 96895
* Move the rest of the unreachable code analysis from libSemaTed Kremenek2010-02-231-201/+14
| | | | | | to libAnalysis (with only the error reporting in libSema). llvm-svn: 96893
* Simplify check for basic block with a CXXTryStmt terminator.Ted Kremenek2010-02-231-3/+2
| | | | llvm-svn: 96892
* Start moving some of the logic for the unreachable code analysis out of libSemaTed Kremenek2010-02-231-46/+15
| | | | | | and into libAnalysis. llvm-svn: 96872
* Convert use of std::queue to llvm::SmallVector and fix buildbot.Ted Kremenek2010-02-231-30/+33
| | | | llvm-svn: 96855
* More support for ivars in class extension.Fariborz Jahanian2010-02-231-6/+2
| | | | llvm-svn: 96850
* Use SmallVectorImpl::iterator.Ted Kremenek2010-02-231-4/+2
| | | | llvm-svn: 96848
* Simplify logic for determining values of 'ReturnsVoid' and 'HasNoReturn' flags.Ted Kremenek2010-02-231-9/+7
| | | | | | No functionality change. llvm-svn: 96847
* Implement crazy destructor name lookup semantics differently inDouglas Gregor2010-02-231-14/+56
| | | | | | | | | | C++98/03 and C++0x, since the '0x semantics break valid C++98/03 code. This new mess is tracked by core issue 399, which is still unresolved. Fixes PR6358 and PR6359. llvm-svn: 96836
* Early support for declaring ivars in class extensions. wip.Fariborz Jahanian2010-02-221-0/+13
| | | | llvm-svn: 96819
* Do not require a complete type when checking for a pointer conversionDouglas Gregor2010-02-221-0/+1
| | | | | | between cv1 T* and cv2 T*. llvm-svn: 96787
* Add 'previous declaration is here' note for param redefinition Chris Lattner2010-02-221-3/+2
| | | | | | | | | | | | | errors, e.g.: t.c:1:21: error: redefinition of parameter 'x' int test(int x, int x); ^ t.c:1:14: note: previous declaration is here int test(int x, int x); ^ llvm-svn: 96769
* Eliminate the default arguments to ASTContext::getFunctionType(),Douglas Gregor2010-02-216-20/+59
| | | | | | | | fixing up a few callers that thought they were propagating NoReturn information but were in fact saying something about exception specifications. llvm-svn: 96766
* Implement support for parsing pseudo-destructor expression with a ↵Douglas Gregor2010-02-216-30/+73
| | | | | | | | | | | | nested-name-specifier, e.g., typedef int Int; int *p; p->Int::~Int(); This weakens the invariant that the only types in nested-name-specifiers are tag types (restricted to class types in C++98/03). However, we weaken this invariant as little as possible, accepting arbitrary types in nested-name-specifiers only when we're in a member access expression that looks like a pseudo-destructor expression. llvm-svn: 96743
* A constructor template cannot be used to copy to an object of the same class ↵Douglas Gregor2010-02-211-1/+2
| | | | | | type (per C++ [class.copy]p3). Make sure that includes copies that involve a derived-to-base conversion. Fixes PR6141. llvm-svn: 96742
* Commiting a revert from dgregor of a bit of destructor logic until we canChandler Carruth2010-02-211-17/+11
| | | | | | | figure out how not to break lots of code using this. See PR6358 and PR6359 for motivating examples. FIXME's left in the code and the test. llvm-svn: 96733
* Make Decl::isOutOfLine() virtual, and use that to determine when definitionsChandler Carruth2010-02-211-8/+9
| | | | | | | are for out of line declarations more easily. This simplifies the logic and handles the case of out-of-line class definitions correctly. Fixes PR6107. llvm-svn: 96729
* Clang really intends to reject attribute 'warn_unused_result' on Objective-C ↵Ted Kremenek2010-02-211-1/+1
| | | | | | | | | methods, but instead it crashes on them. We might extend this attribute to work on methods, but for now fix the crasher. Addresses <rdar://problem/7670939>. llvm-svn: 96723
* Don't emit a warning about a dllimport attribute being used in a typedefTed Kremenek2010-02-211-2/+6
| | | | | | when -fms-extensions is specified. Fixes <rdar://problem/7653870>. llvm-svn: 96722
* Don't warn about functions redeclared without the dllimport attribute whenTed Kremenek2010-02-211-1/+5
| | | | | | -fms-extensions is enabled. Fixes <rdar://problem/7669559>. llvm-svn: 96721
* Start supporting declaration of ivars in @implementationFariborz Jahanian2010-02-191-1/+20
| | | | | | blocks. WIP. llvm-svn: 96696
* Issue extended diagnostic when property dot-syntax is used and Fariborz Jahanian2010-02-191-4/+7
| | | | | | there is a setter but no getter (part of radar 7664555). llvm-svn: 96687
* Implement C++ name lookup for instance variables of Objective-C classesDouglas Gregor2010-02-191-7/+30
| | | | | | | | | | | | from an instance method. Previously, we were following the Objective-C name lookup rules for ivars, which are of course completely different from and incompatible with the Objective-C++ rules. For the record, the Objective-C++ rules are the sane ones. This is another part of <rdar://problem/7660386>. llvm-svn: 96677
* Make Sema::ActOnClassMessage robust when name lookup for the receiverDouglas Gregor2010-02-191-8/+8
| | | | | | | name finds something other than a TypedefDecl or an ObjCInterfaceDecl. This is a small part of <rdar://problem/7660386>. llvm-svn: 96676
* Revert: "Change InitListExpr to allocate the array for holding references"Ted Kremenek2010-02-192-13/+12
| | | | | | | | This was causing buildbot breakage. This reverts commit d46e952cc8cb8d9eed8657d9a0b267910a0f745a. llvm-svn: 96652
* Change InitListExpr to allocate the array for holding referencesTed Kremenek2010-02-192-12/+13
| | | | | | | | | | | | | | | | to initializer expressions in an array allocated using ASTContext. This plugs a memory leak when ASTContext uses a BumpPtrAllocator to allocate memory for AST nodes. In my mind this isn't an ideal solution; it would be nice to have a general "vector"-like class that allocates memory using ASTContext, but whose guts could be separated from the methods of InitListExpr itself. I haven't gone and taken this approach yet because it isn't clear yet if we'll eventually want an alternate solution for recylcing memory using by InitListExprs as we are constructing the ASTs. llvm-svn: 96642
* Patch removes IVars list from ObjCInterfaceDecl andFariborz Jahanian2010-02-192-4/+2
| | | | | | instead relies on their DeclContext for iteration, etc. llvm-svn: 96638
* Fixed a crash specific to blocks in c++ uncovered by an internalFariborz Jahanian2010-02-181-1/+3
| | | | | | test suite. llvm-svn: 96608
* Also don't warn about force_align_arg_pointer on function typedefs. (This willCharles Davis2010-02-181-1/+2
| | | | | | | break if you declare an actual function using that typedef. Come to think of it, maybe I should make this part of the type.) llvm-svn: 96570
* Two fixes related to force_align_arg_pointer:Charles Davis2010-02-181-2/+7
| | | | | | | - Also recognize __force_align_arg_pointer__. - Don't warn if it's used on a function pointer typedef. llvm-svn: 96568
* Add some spacing in the code-completion results for a return statementDouglas Gregor2010-02-181-1/+3
| | | | llvm-svn: 96567
* Change the behavior of ibaction attributes to be attached to methods, not ivars.Ted Kremenek2010-02-181-16/+25
| | | | llvm-svn: 96562
* Allow redefinitions of extern inline functions in GNU89 mode, just as GCCCharles Davis2010-02-181-2/+18
| | | | | | does. Fixes PR5253. llvm-svn: 96553
* Don't diagnose overflow in case statements when the conversion is aDouglas Gregor2010-02-181-3/+3
| | | | | | | signed<->unsigned conversion with the same bit width. Fixes <rdar://problem/7658121>. llvm-svn: 96545
* Add 'ns_returns_not_retained' and 'cf_returns_not_retained' attributes toTed Kremenek2010-02-181-0/+8
| | | | | | | match 'ns_returns_retained' and 'cf_returns_retained' respectively. These are not yet hooked up to the static analyzer. llvm-svn: 96535
* For -Wswitch-enum warnings, be sure to look through typedefs of enumDouglas Gregor2010-02-171-1/+1
| | | | | | types. Fixes <rdar://problem/7643909>. llvm-svn: 96531
* When diagnosing enumerator values outside of the range of 'int', beDouglas Gregor2010-02-171-1/+1
| | | | | | | sure that we get the "too large" vs. "too small" part of the diagnostic correct. llvm-svn: 96524
* Use proper lexcial context for newly added ivars.Fariborz Jahanian2010-02-171-2/+2
| | | | llvm-svn: 96484
* Allow for declaration and use of ivars in a stand-aloneFariborz Jahanian2010-02-171-0/+6
| | | | | | implementation (toward radar 7547942). llvm-svn: 96479
* Do not add functions marked with the unused attribute to the list of unused ↵Tanya Lattner2010-02-171-1/+1
| | | | | | functions to warn about. Update test case. llvm-svn: 96452
* Add IBAction attribute to keep the IBOutlet attribute company.Ted Kremenek2010-02-171-7/+18
| | | | llvm-svn: 96447
* Revert r95939, as suggested by Alexandre Julliard from the Wine project (andCharles Davis2010-02-171-6/+4
| | | | | | our own Chris Lattner). llvm-svn: 96431
* Introduce a new kind of failed result for isLvalue/isModifiableLvalueDouglas Gregor2010-02-161-1/+10
| | | | | | | | which describes temporary objects of class type in C++. Use this to provide a more-specific, remappable diagnostic when takin the address of such a temporary. llvm-svn: 96396
* Do not try to instantiate invalid declarations. It's a recipe forDouglas Gregor2010-02-161-0/+3
| | | | | | disaster. Fixes PR6161. llvm-svn: 96371
OpenPOWER on IntegriCloud