summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove remaining VISIBILITY_HIDDEN from anonymous namespaces.Benjamin Kramer2009-11-287-14/+6
| | | | llvm-svn: 90044
* Fix test and handle IK_LiteralOperatorId in a few more places.Alexis Hunt2009-11-281-1/+8
| | | | llvm-svn: 90030
* Add Parser support for C++0x literal operators ('operator "" i').Alexis Hunt2009-11-283-1/+6
| | | | | | DeclarationName can't handle them yet, so right now Parser just errors out on them. llvm-svn: 90027
* More work on ScalarExprEmitter::EmitCastExpr: for every cast kind, eitherEli Friedman2009-11-271-11/+15
| | | | | | | | | | | implement it explicitly or assert that it doesn't make sense for a scalar. This caught a couple interesting issues: one, CK_BaseToDerivedMemberPointer casts were getting silently miscompiled, and two, Sema was constructing some strange implicit casts of type CK_UserDefinedConversion. The change in SemaExprCXX makes sure the cast kinds are getting set correctly. llvm-svn: 89987
* Fix thinko.Anders Carlsson2009-11-271-2/+1
| | | | llvm-svn: 89983
* When adding an implicit destructor, make sure to mark it as virtual if it ↵Anders Carlsson2009-11-261-0/+2
| | | | | | overrides existing destructors. llvm-svn: 89967
* Correctly find overridden destructors.Anders Carlsson2009-11-261-2/+15
| | | | llvm-svn: 89966
* Refactor our handling of expression evaluation contexts, so that SemaDouglas Gregor2009-11-264-40/+80
| | | | | | | | | | | | 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-253-2/+23
| | | | | | This fixes pr5611. llvm-svn: 89895
* Implement the rules in C++ [basic.link] and C99 6.2.2 for computingDouglas Gregor2009-11-251-2/+2
| | | | | | | | | | | 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
* Better diagnostic on deleted constructor when noFariborz Jahanian2009-11-251-2/+5
| | | | | | initializer name is available. llvm-svn: 89885
* Implement support for default template arguments of function templates.Douglas Gregor2009-11-253-16/+108
| | | | llvm-svn: 89874
* Diagnose ill-formed uses of default template arguments inDouglas Gregor2009-11-254-7/+107
| | | | | | | | | | | 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
* Fix a thinko where we weren't always performing unary conversions on the ↵Douglas Gregor2009-11-251-4/+4
| | | | | | switch condition, fixing PR5612 llvm-svn: 89864
* When the condition of a switch() statement is semantically invalid,Douglas Gregor2009-11-251-6/+7
| | | | | | | still parse the body of the switch to try to avoid spurious diagnostics. Fixes PR5606. llvm-svn: 89847
* Don't crash when we re-use a template specialization node for an explicit ↵Douglas Gregor2009-11-251-5/+9
| | | | | | instantiation. lib/Support/CommandLine.cpp is our test case llvm-svn: 89845
* Refactor ActOnFinishSwitchStmt to simplify it furtherDouglas Gregor2009-11-251-14/+6
| | | | llvm-svn: 89843
* Refactor ActOnFinishSwitchStmt to simplify and reduce nestingDouglas Gregor2009-11-251-93/+106
| | | | llvm-svn: 89842
* Parse C++ member check attributes - base_check, hiding, and override.Alexis Hunt2009-11-251-43/+125
| | | | | | The attributes are currently ignored. llvm-svn: 89837
* Some fancy footwork to move the decision on how Fariborz Jahanian2009-11-253-7/+14
| | | | | | to build casted expression-list AST to Sema. llvm-svn: 89827
* Eliminate CXXConditionDeclExpr with extreme prejudice.Douglas Gregor2009-11-255-181/+168
| | | | | | | | | | | | | | | | | 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-242-3/+4
| | | | | | definition. This allows sema to not emit spurious diagnostics in some invalid code. llvm-svn: 89816
* Refactor argument collection of constructor calls usingFariborz Jahanian2009-11-244-52/+14
| | | | | | the common routine. llvm-svn: 89802
* Clean up the AST for while loops and fix several problems withDouglas Gregor2009-11-242-2/+23
| | | | | | | | | | | | | | | | | 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
* Fix some major problems dealing with dependently-qualified names in implicitJohn McCall2009-11-241-4/+11
| | | | | | member-reference contexts. Fixes some clang-on-clang asserts. llvm-svn: 89796
* More cleanup of argument call collection.Fariborz Jahanian2009-11-243-20/+26
| | | | llvm-svn: 89789
* Rip out TemplateIdRefExpr and make UnresolvedLookupExpr and John McCall2009-11-2411-582/+727
| | | | | | | | | | | | DependentScopeDeclRefExpr support storing templateids. Unite the common code paths between ActOnDeclarationNameExpr and ActOnTemplateIdExpr. This gets us to a point where we don't need to store function templates in the AST using TemplateNames, which is critical to ripping out OverloadedFunction. Also resolves a few FIXMEs. llvm-svn: 89785
* Refactor collection of call arguments in common code.Fariborz Jahanian2009-11-243-48/+64
| | | | | | | 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-3/+4
| | | | llvm-svn: 89778
* Explicitly store the condition variable within switch statements, andDouglas Gregor2009-11-242-2/+23
| | | | | | | make sure that this variable is destroyed when we exit the switch statement. llvm-svn: 89776
* Fix a crash when "instantiating" VarDecls that are neither type nor value ↵Anders Carlsson2009-11-241-0/+1
| | | | | | dependent. llvm-svn: 89774
* Un-break instantiation of if statements with conditional variablesDouglas Gregor2009-11-241-1/+10
| | | | llvm-svn: 89767
* Set the template specialization kind before instantiating the function ↵Anders Carlsson2009-11-241-2/+2
| | | | | | definition so that the function will have the right linkage. llvm-svn: 89740
* Explicitly track the condition variable within an "if" statement,Douglas Gregor2009-11-234-5/+48
| | | | | | | | | rather than burying it in a CXXConditionDeclExpr (that occassionally hides behind implicit conversions). Similar changes for switch, while, and do-while will follow, then the removal of CXXConditionDeclExpr. This commit is the canary. llvm-svn: 89717
* Convert the && and || operands to bool using standard conversions. Fixes PR5593.Anders Carlsson2009-11-231-9/+31
| | | | llvm-svn: 89704
* Handle converting member pointers to bool.Anders Carlsson2009-11-231-2/+7
| | | | llvm-svn: 89692
* Fix a recent regression probably caused by addition of altivec-styleFariborz Jahanian2009-11-231-0/+3
| | | | | | type-casts in the parser. llvm-svn: 89691
* Make 'SEL' pointer to a builtin type and not anFariborz Jahanian2009-11-231-1/+1
| | | | | | | objective-c pointer type. This was a serious mishap and luckily, Ted's test caught that (and patch fixes the test case). llvm-svn: 89680
* Intercept sizeof and alignof references before they get into ASTContext ↵Sebastian Redl2009-11-231-0/+7
| | | | | | methods. This fixes a crash when writing sizeof(Incomplete&), and lets ASTContext's methods do the right thing for CodeGen, which fixes PR5590. llvm-svn: 89668
* Let using directives refer to namespace aliases. Fixes PR5479.Sebastian Redl2009-11-231-17/+14
| | | | llvm-svn: 89657
* Require a class type to be complete before probing its conversionDouglas Gregor2009-11-231-0/+7
| | | | | | | functions for a switch condition's conversion to integral or enumeration type. llvm-svn: 89656
* Implement conversion from a switch condition with class type to anDouglas Gregor2009-11-231-32/+98
| | | | | | integral or enumeration type (vi user-defined conversions). Fixes PR5518. llvm-svn: 89655
* Improve type-checking of templates by distinguishing between membersDouglas Gregor2009-11-231-6/+2
| | | | | | | of the current instantiation and members of an unknown specialization when type-checking a qualified-if expression. llvm-svn: 89653
* Do not mark declarations as used when performing overload resolution. Fixes ↵Douglas Gregor2009-11-233-4/+21
| | | | | | PR5541 llvm-svn: 89652
* Tolerate extraneous "template<>" headers better, downgrading theDouglas Gregor2009-11-231-4/+16
| | | | | | | | | | complaint to a warning and providing a helpful node in the case where the "template<>" header is redundant because the corresponding template-id refers to an explicit specialization. C++0x might still change this behavior, and existing practice is all over the place on the number of "template<>" headers actually needed. llvm-svn: 89651
* Centralize and complete the computation of value- and type-dependence for ↵Douglas Gregor2009-11-235-70/+11
| | | | | | DeclRefExprs llvm-svn: 89649
* Encapsulate "an array of TemplateArgumentLocs and two angle bracket ↵John McCall2009-11-2310-364/+214
| | | | | | | | | | locations" into a new class. Use it pervasively throughout Sema. My fingers hurt. llvm-svn: 89638
* Fix LookupResult's sanity-check to handle shadow decls.John McCall2009-11-221-1/+2
| | | | llvm-svn: 89624
* If a C++ qualified id is followed by a postfix suffix, it is never the directJohn McCall2009-11-221-1/+4
| | | | | | | | | | | | | | operand of an addressof operator, and so we should not treat it as an abstract member-pointer expression and therefore suppress the implicit member access. This is really a well-formedness constraint on expressions: a DeclRefExpr of a FieldDecl or a non-static CXXMethodDecl (or template thereof, or unresolved collection thereof) should not be allowed in an arbitrary location in the AST. Arguably it shouldn't be allowed anywhere and we should have a different expr node type for this. But unfortunately we don't have a good way of enforcing this kind of constraint right now. llvm-svn: 89578
* Reorganize the intermediate BuildDeclarationNameExpr routines again.John McCall2009-11-223-87/+82
| | | | llvm-svn: 89575
OpenPOWER on IntegriCloud