summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
* cleanup parsing of MS integer suffixes a little. this fixes PR5616Nuno Lopes2009-11-281-0/+12
| | | | | | btw, I believe that isMicrosoftInteger can go away; it's not read anywhere llvm-svn: 90036
* Fix test and handle IK_LiteralOperatorId in a few more places.Alexis Hunt2009-11-281-1/+1
| | | | llvm-svn: 90030
* Add Parser support for C++0x literal operators ('operator "" i').Alexis Hunt2009-11-281-0/+5
| | | | | | DeclarationName can't handle them yet, so right now Parser just errors out on them. llvm-svn: 90027
* Add a much more thorough test of casts to virtual bases, and fixEli Friedman2009-11-281-7/+31
| | | | | | GetCXXBaseClassOffset to actually pass the test. llvm-svn: 90025
* Some member pointer casting tests.Eli Friedman2009-11-272-0/+26
| | | | llvm-svn: 89989
* Fix for PR5594: use EmitGlobalDefinition instead of EmitCXXDestructor so thatEli Friedman2009-11-271-0/+9
| | | | | | we check whether the vtable needs to be generated. llvm-svn: 89984
* Simplify and fix up the handling of implicit constructors, copy assignmentEli Friedman2009-11-261-0/+4
| | | | | | | | operators, and destructors. Avoids generating declarations/definitions of trivial constructors/destructors, and makes sure the trivial copy assignment operator is generated when necessary. llvm-svn: 89943
* Improve diagnostics in ReturnStackAddressChecker for returning a ↵Ted Kremenek2009-11-261-2/+15
| | | | | | stack-allocated block. Implements the rest of <rdar://problem/7387385>. llvm-svn: 89940
* Add test case that shows that dead stores checking now works in the presence ↵Ted Kremenek2009-11-261-5/+21
| | | | | | of blocks. llvm-svn: 89939
* Implement IRGen for MemberExpr referring to static member function.Eli Friedman2009-11-261-0/+8
| | | | llvm-svn: 89938
* Slight tweak to the algorithm for getLinkage().Eli Friedman2009-11-261-0/+5
| | | | llvm-svn: 89932
* Use new getLinkage() method to correctly compute whether a variable hasEli Friedman2009-11-261-0/+8
| | | | | | internal linkage. Fixes PR5433. llvm-svn: 89931
* Add a PostVisitBlockExpr() method to RetainReleaseChecker to query forTed Kremenek2009-11-261-2/+0
| | | | | | | | the set of variables "captured" by a block. Until the analysis gets more sophisticated, for now we stop the retain count tracking of any objects (transitively) referenced by these variables. llvm-svn: 89929
* Refactor our handling of expression evaluation contexts, so that SemaDouglas Gregor2009-11-261-1/+35
| | | | | | | | | | | | maintains a stack of evaluation contexts rather than having the parser do it. This change made it simpler to track in which contexts temporaries were created, so that we could... "Forget" about temporaries created within unevaluated contexts, so that we don't build a CXXExprWithTemporaries and, therefore, destroy the integral-constness of our expressions. Fixes PR5609. llvm-svn: 89908
* Allow user re-definition of SEL as well as accessing its fields.Fariborz Jahanian2009-11-251-0/+4
| | | | | | This fixes pr5611. llvm-svn: 89895
* Fix attribute between function decl ')' and '{' or '=0'John Thompson2009-11-252-0/+10
| | | | llvm-svn: 89894
* Implement the rules in C++ [basic.link] and C99 6.2.2 for computingDouglas Gregor2009-11-253-1/+20
| | | | | | | | | | | the linkage of a declaration. Switch the lame (and completely wrong) NamedDecl::hasLinkage() over to using the new NamedDecl::getLinkage(), along with the "can this declaration be a template argument?" check that started all of this. Fixes -fsyntax-only for PR5597. llvm-svn: 89891
* Tweak expected error to match what should happen, once using declarations workDouglas Gregor2009-11-251-3/+2
| | | | llvm-svn: 89876
* Tweak expected error message, although we still fail this testDouglas Gregor2009-11-251-1/+1
| | | | llvm-svn: 89875
* Implement support for default template arguments of function templates.Douglas Gregor2009-11-252-1/+27
| | | | llvm-svn: 89874
* Diagnose ill-formed uses of default template arguments inDouglas Gregor2009-11-251-0/+23
| | | | | | | | | | | function templates (in C++98), friend function templates, and out-of-line definitions of members of class templates. Also handles merging of default template arguments from previous declarations of function templates, for C++0x. However, we don't yet make use of those default template arguments. llvm-svn: 89872
* When the condition of a switch() statement is semantically invalid,Douglas Gregor2009-11-251-1/+11
| | | | | | | still parse the body of the switch to try to avoid spurious diagnostics. Fixes PR5606. llvm-svn: 89847
* Parse C++ member check attributes - base_check, hiding, and override.Alexis Hunt2009-11-251-0/+12
| | | | | | The attributes are currently ignored. llvm-svn: 89837
* Add VTT parameter to base ctors/dtors with virtual bases. (They aren't used ↵Anders Carlsson2009-11-251-0/+17
| | | | | | yet). llvm-svn: 89835
* Implement proper cleanup semantics for condition variables in forDouglas Gregor2009-11-251-1/+6
| | | | | | | | | | statements, e.g., for(; X x = X(); ) { ... } Daniel or Anders, please review! llvm-svn: 89832
* Add really basic support for blocks in the retain/release checker. For now, ↵Ted Kremenek2009-11-251-2/+35
| | | | | | anytime we pass a tracked object to a block call we stop tracking it. llvm-svn: 89831
* Tweak the code-generation-for-condition-variables test case to get to what ↵Douglas Gregor2009-11-251-3/+3
| | | | | | we want to test llvm-svn: 89818
* Eliminate CXXConditionDeclExpr with extreme prejudice.Douglas Gregor2009-11-252-0/+22
| | | | | | | | | | | | | | | | | All statements that involve conditions can now hold on to a separate condition declaration (a VarDecl), and will use a DeclRefExpr referring to that VarDecl for the condition expression. ForStmts now have such a VarDecl (I'd missed those in previous commits). Also, since this change reworks the Action interface for if/while/switch/for, use FullExprArg for the full expressions in those expressions, to ensure that we're emitting Note that we are (still) not generating the right cleanups for condition variables in for statements. That will be a follow-on commit. llvm-svn: 89817
* Have the parser tell sema whether a member declaration is a function ↵Sebastian Redl2009-11-241-3/+2
| | | | | | definition. This allows sema to not emit spurious diagnostics in some invalid code. llvm-svn: 89816
* Convert test case to FileCheck to test the behavior of the nil-receiver ↵Ted Kremenek2009-11-241-2/+16
| | | | | | checker when the code is targetted for either Tiger or Leopard. llvm-svn: 89810
* For the nil-receiver checker, take into account the behavioral changes that ↵Ted Kremenek2009-11-241-2/+2
| | | | | | got introduced in Mac OS X 10.5 and later, notably return values of double, float, etc., will not be garbage. Fixes <rdar://problem/6829160>. llvm-svn: 89809
* Cleanups and fixes to the nil-receiver checker, some of it fallout theTed Kremenek2009-11-242-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | initial transition of the nil-receiver checker to the Checker interface as done in r89745. Some important changes include: 1) We consolidate the BugType object used for nil receiver bug reports, and don't include the type of the returned value in the BugType (which would be wrong if a nil receiver bug was reported more than once) 2) Added a new (temporary) flag to CheckerContext: DoneEvauating. This is used by GRExprEngine when evaluating message expressions to not continue evaluating the message expression if this flag is set. This flag is currently set by the nil receiver checker. This is an intermediate solution to allow the nil-receiver checker to properly work as a plug-in outside of GRExprEngine. Basically, this flag indicates that the entire message expression has been evaluated, not just a precondition (which is what the nil-receiver checker does). This flag *should not* be repurposed for general use, but just to pull more things out of GRExprEngine that already in there as we devise a better interface in the Checker class. 3) Cleaned up the logic in the nil-receiver checker, making the control-flow a lot easier to read. llvm-svn: 89804
* "Do" loops cannot have condition variables, so don't parse them.Douglas Gregor2009-11-241-3/+0
| | | | llvm-svn: 89801
* Clean up the AST for while loops and fix several problems withDouglas Gregor2009-11-241-0/+20
| | | | | | | | | | | | | | | | | cleanups for while loops: 1) Make sure that we destroy the condition variable of a while statement each time through the loop for, e.g., while (shared_ptr<WorkInt> p = getWorkItem()) { // ... } 2) Make sure that we always enter a new cleanup scope for the body of the while loop, even when there is no compound expression, e.g., while (blah) RAIIObject raii(blah+1); llvm-svn: 89800
* Handle references correctly when synthesizing copy constructors.Anders Carlsson2009-11-241-0/+11
| | | | | | | | | | | With this change, the clang-on-clang test result is now Expected Passes : 224 Unexpected Failures: 37 Which means that we can compile over 80% of clang with clang! :) llvm-svn: 89799
* Fix some major problems dealing with dependently-qualified names in implicitJohn McCall2009-11-241-0/+70
| | | | | | member-reference contexts. Fixes some clang-on-clang asserts. llvm-svn: 89796
* Fix the test case failed in buildbot.Fariborz Jahanian2009-11-241-1/+1
| | | | llvm-svn: 89791
* Handle cases where we're constructing an array of objects and the ↵Anders Carlsson2009-11-241-1/+57
| | | | | | constructor has default arguments. llvm-svn: 89783
* Refactor collection of call arguments in common code.Fariborz Jahanian2009-11-241-0/+11
| | | | | | | Add support for variadic collection functions. More to do here. llvm-svn: 89781
* GNUNullExpr is a valid sentinel even though it isn't of pointer type.Anders Carlsson2009-11-241-0/+6
| | | | llvm-svn: 89778
* Make sure redeclaration chains are properly linked, even through invalid ↵Sebastian Redl2009-11-241-0/+9
| | | | | | decls. This fixes PR5415. llvm-svn: 89777
* Explicitly store the condition variable within switch statements, andDouglas Gregor2009-11-241-0/+24
| | | | | | | make sure that this variable is destroyed when we exit the switch statement. llvm-svn: 89776
* We always need to emit the base expression of a member expression, even when ↵Anders Carlsson2009-11-241-1/+12
| | | | | | the member decl refers to an enum. Thanks to Eli for pointing this out! llvm-svn: 89775
* Fix a crash when "instantiating" VarDecls that are neither type nor value ↵Anders Carlsson2009-11-241-0/+11
| | | | | | dependent. llvm-svn: 89774
* Introduce cleanup scopes for "if" statements in two places:Douglas Gregor2009-11-241-0/+47
| | | | | | | | | | | | | | | | - Outside the "if", to ensure that we destroy the condition variable at the end of the "if" statement rather than at the end of the block containing the "if" statement. - Inside the "then" and "else" branches, so that we emit then- or else-local cleanups at the end of the corresponding block when the block is not a compound statement. To make adding these new cleanup scopes easier (and since switch/do/while will all need the same treatment), added the CleanupScope RAII object to introduce a new cleanup scope and make sure it gets cleaned up. llvm-svn: 89773
* When mangling a ctor/dtor we need to take into consideration whether it's a ↵Anders Carlsson2009-11-241-0/+11
| | | | | | member template. llvm-svn: 89741
* Ignore constructor member templates in CodeGenModule::EmitTopLevelDecl.Anders Carlsson2009-11-241-0/+9
| | | | llvm-svn: 89737
* It is common for vtables to contain pointers to functions that have either ↵Anders Carlsson2009-11-241-0/+30
| | | | | | | | incomplete return types or incomplete argument types. Handle this by returning the llvm::OpaqueType for those cases, which CodeGenModule::GetOrCreateLLVMFunction knows about, and treats as being an "incomplete function". llvm-svn: 89736
* Enhance null dereference diagnostics by indicating what variable (if any) ↵Ted Kremenek2009-11-242-6/+735
| | | | | | was dereferenced. Addresses <rdar://problem/7039161>. llvm-svn: 89726
* Don't try to treat an enum constant as an lvalue.Anders Carlsson2009-11-231-0/+8
| | | | llvm-svn: 89705
OpenPOWER on IntegriCloud