summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/Sema.h
Commit message (Collapse)AuthorAgeFilesLines
* Unify the end-of-class code paths used by the parser and templateDouglas Gregor2009-12-031-0/+1
| | | | | | | | | | | | | | instantiation, to ensure that we mark class template specilizations as abstract when we need to and perform checking of abstract classes. Also, move the checking that determines whether we are creating a variable of abstract class type *after* we check whether the type is complete. Otherwise, we won't see when we have an abstract class template specialization that is implicitly instantiated by this declaration. This is the "something else" that Sebastian had noted earlier. llvm-svn: 90467
* When instantiating a class, if a base specifier is not dependent we still ↵Anders Carlsson2009-12-031-0/+8
| | | | | | need to copy its attributes down to the instantiated class. llvm-svn: 90463
* Honor using declarations in overload resolution. Most of the code forJohn McCall2009-12-031-6/+12
| | | | | | | | | | | overloaded-operator resolution is wildly untested, but the parallel code for methods seems to satisfy some trivial tests. Also change some overload-resolution APIs to take a type instead of an expression, which lets us avoid creating a spurious CXXThisExpr when resolving implicit member accesses. llvm-svn: 90410
* Improve source location information for C++ member initializers in aDouglas Gregor2009-12-021-2/+5
| | | | | | | constructor, by keeping the DeclaratorInfo* rather than just the type and a single location. llvm-svn: 90355
* In Sema, whenever we think that a function is going to cause a vtable to be ↵Anders Carlsson2009-12-021-3/+8
| | | | | | generated, we mark any virtual implicit member functions as referenced. llvm-svn: 90327
* Rip out the last remaining implicit use of OverloadedFunctionDecl in Sema:John McCall2009-12-021-1/+1
| | | | | | | LookupResult::getAsSingleDecl() is no more. Shift Sema::LookupSingleName to return null on overloaded results. llvm-svn: 90309
* Stop trying to analyze class-hierarchies for dependently-scoped id-expressions;John McCall2009-12-021-3/+2
| | | | | | | | | | | | | there's nothing interesting we can say now that we're correctly not requiring the qualifier to name a known base class in dependent contexts. Require scope specifiers on member access expressions to name complete types if they're not dependent; delay lookup when they are dependent. Use more appropriate diagnostics when qualified implicit member access expressions find declarations from unrelated classes. llvm-svn: 90289
* Fix a code gen. crash synthesizing a destructor.Fariborz Jahanian2009-12-011-2/+3
| | | | | | Fixes pr5660. llvm-svn: 90283
* Rework how we support C++ implicit member accesses. If we can resolve anJohn McCall2009-12-011-4/+13
| | | | | | | | | | | | | | | implicit member access to a specific declaration, go ahead and create it as a DeclRefExpr or a MemberExpr (with implicit CXXThisExpr base) as appropriate. Otherwise, create an UnresolvedMemberExpr or DependentScopeMemberExpr with a null base expression. By representing implicit accesses directly in the AST, we get the ability to correctly delay the decision about whether it's actually an instance member access or not until resolution is complete. This permits us to correctly avoid diagnosing the 'problem' of 'MyType::foo()' where the relationship to the type isn't really known until instantiation. llvm-svn: 90266
* Move the checking of overridden virtual functions into the code pathDouglas Gregor2009-12-011-0/+1
| | | | | | | | | | | | | | | common to both parsing and template instantiation, so that we'll find overridden virtuals for member functions of class templates when they are instantiated. Additionally, factor out the checking for pure virtual functions, so that it will be executed both at parsing time and at template instantiation time. These changes fix PR5656 (for real), although one more tweak w.r.t. member function templates will be coming along shortly. llvm-svn: 90241
* Eliminate the use of OverloadedFunctionDecl in member expressions.John McCall2009-11-301-28/+42
| | | | | | | | Create a new UnresolvedMemberExpr for these lookups. Assorted hackery around qualified member expressions; this will all go away when we implement the correct (i.e. extremely delayed) implicit-member semantics. llvm-svn: 90161
* When we're trying to define an implicit virtual destructor, make sure that ↵Anders Carlsson2009-11-301-1/+1
| | | | | | we have a valid delete operator. llvm-svn: 90156
* Refactor our handling of expression evaluation contexts, so that SemaDouglas Gregor2009-11-261-14/+43
| | | | | | | | | | | | 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
* Implement support for default template arguments of function templates.Douglas Gregor2009-11-251-0/+7
| | | | llvm-svn: 89874
* Diagnose ill-formed uses of default template arguments inDouglas Gregor2009-11-251-1/+12
| | | | | | | | | | | 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
* Some fancy footwork to move the decision on how Fariborz Jahanian2009-11-251-2/+3
| | | | | | to build casted expression-list AST to Sema. llvm-svn: 89827
* Eliminate CXXConditionDeclExpr with extreme prejudice.Douglas Gregor2009-11-251-13/+12
| | | | | | | | | | | | | | | | | 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-1/+1
| | | | | | 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-241-1/+0
| | | | | | the common routine. llvm-svn: 89802
* More cleanup of argument call collection.Fariborz Jahanian2009-11-241-9/+13
| | | | llvm-svn: 89789
* Rip out TemplateIdRefExpr and make UnresolvedLookupExpr and John McCall2009-11-241-30/+38
| | | | | | | | | | | | 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-241-0/+8
| | | | | | | Add support for variadic collection functions. More to do here. llvm-svn: 89781
* Explicitly track the condition variable within an "if" statement,Douglas Gregor2009-11-231-1/+2
| | | | | | | | | 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
* Fix a recent regression probably caused by addition of altivec-styleFariborz Jahanian2009-11-231-0/+3
| | | | | | type-casts in the parser. llvm-svn: 89691
* Centralize and complete the computation of value- and type-dependence for ↵Douglas Gregor2009-11-231-2/+1
| | | | | | DeclRefExprs llvm-svn: 89649
* Encapsulate "an array of TemplateArgumentLocs and two angle bracket ↵John McCall2009-11-231-52/+18
| | | | | | | | | | locations" into a new class. Use it pervasively throughout Sema. My fingers hurt. llvm-svn: 89638
* Reorganize the intermediate BuildDeclarationNameExpr routines again.John McCall2009-11-221-2/+6
| | | | llvm-svn: 89575
* Consider a FunctionTemplate to be an overload all on its lonesome. TrackJohn McCall2009-11-221-0/+2
| | | | | | this information through lookup rather than rederiving it. llvm-svn: 89570
* Overload resolution doesn't decide whether to do ADL or not anymore; stoppingJohn McCall2009-11-211-2/+2
| | | | | | threading that state. llvm-svn: 89557
* "Incremental" progress on using expressions, by which I mean totally rippingJohn McCall2009-11-211-6/+15
| | | | | | | | | | | | | | | | | | | | | | into pretty much everything about overload resolution in order to wean BuildDeclarationNameExpr off LookupResult::getAsSingleDecl(). Replace UnresolvedFunctionNameExpr with UnresolvedLookupExpr, which generalizes the idea of a non-member lookup that we haven't totally resolved yet, whether by overloading, argument-dependent lookup, or (eventually) the presence of a function template in the lookup results. Incidentally fixes a problem with argument-dependent lookup where we were still performing ADL even when the lookup results contained something from a block scope. Incidentally improves a diagnostic when using an ObjC ivar from a class method. This just fell out from rewriting BuildDeclarationNameExpr's interaction with lookup, and I'm too apathetic to break it out. The only remaining uses of OverloadedFunctionDecl that I know of are in TemplateName and MemberExpr. llvm-svn: 89544
* Added rudimentary C++0x attribute support.Alexis Hunt2009-11-211-0/+5
| | | | | | | | | | | | | | The following attributes are currently supported in C++0x attribute lists (and in GNU ones as well): - align() - semantics believed to be conformant to n3000, except for redeclarations and what entities it may apply to - final - semantics believed to be conformant to CWG issue 817's proposed wording, except for redeclarations - noreturn - semantics believed to be conformant to n3000, except for redeclarations - carries_dependency - currently ignored (this is an optimization hint) llvm-svn: 89543
* Cope with extraneous "template" keyword when providing an out-of-lineDouglas Gregor2009-11-201-1/+2
| | | | | | definition of a member template (or a member thereof). Fixes PR5566. llvm-svn: 89512
* Implement C++ [basic.lookup.classref]p3, which states how the typeDouglas Gregor2009-11-201-1/+2
| | | | | | | | | | | | name 'T' is looked up in the expression t.~T() Previously, we weren't looking into the type of "t", and therefore would fail when T actually referred to an injected-class-name. Fixes PR5530. llvm-svn: 89493
* Don't issue spurious diagnostic with Obj-C fast enumeration.Fariborz Jahanian2009-11-191-0/+1
| | | | | | (radar 7409165). llvm-svn: 89400
* Objective-C code completion within properties after "setter = " orDouglas Gregor2009-11-191-0/+7
| | | | | | "getter = ", to provide suitable method names. llvm-svn: 89334
* Improve code completion for Objective-C message sends, so that weDouglas Gregor2009-11-191-2/+6
| | | | | | | | | | | provide completion results before each keyword argument, e.g., [foo Method:arg WithArg1:arg1 WithArg2:arg2] We now complete before "WithArg1" and before "WithArg2", in addition to completing before "Method". llvm-svn: 89290
* Rename CodeCompleteObjCProperty to something more specific. No functionality ↵Douglas Gregor2009-11-181-1/+1
| | | | | | change. llvm-svn: 89267
* Code completion after @dynamicDouglas Gregor2009-11-181-1/+1
| | | | llvm-svn: 89265
* Overhaul previous-declaration and overload checking to work on lookup resultsJohn McCall2009-11-181-12/+19
| | | | | | | rather than NamedDecl*. This is a major step towards eliminating OverloadedFunctionDecl. llvm-svn: 89263
* Code completion for Objective-C @synthesized.Douglas Gregor2009-11-181-0/+5
| | | | llvm-svn: 89259
* Track overriding methods when instantiating a template class. Fixes PR5550.Sebastian Redl2009-11-181-0/+1
| | | | llvm-svn: 89248
* Implement code completion for Objective-C category names in @interfaceDouglas Gregor2009-11-181-0/+4
| | | | | | and @implementation declarations. llvm-svn: 89223
* Improve on diagnosing type mismatches because of Fariborz Jahanian2009-11-181-1/+1
| | | | | | lack of viable convesion functions. llvm-svn: 89216
* Code completion for Objective-C class names after @interface,Douglas Gregor2009-11-181-1/+5
| | | | | | | @implementation, and in the declaration of the superclass of an @interface. llvm-svn: 89207
* Split LookupResult into its own header.John McCall2009-11-181-380/+6
| | | | llvm-svn: 89199
* Code completion after @property, providing the names of forward-declared ↵Douglas Gregor2009-11-181-1/+2
| | | | | | properties llvm-svn: 89196
* Code completion for Objective-C properly listsDouglas Gregor2009-11-181-0/+2
| | | | llvm-svn: 89194
* Incremental progress on using declarations. Split UnresolvedUsingDecl intoJohn McCall2009-11-181-2/+11
| | | | | | | | | | two classes, one for typenames and one for values; this seems to have some support from Doug if not necessarily from the extremely-vague-on-this-point standard. Track the location of the 'typename' keyword in a using-typename decl. Make a new lookup result for unresolved values and deal with it in most places. llvm-svn: 89184
* Rename Objective-C message send completion functions to indicate that we're ↵Douglas Gregor2009-11-171-2/+3
| | | | | | referring to message sends llvm-svn: 89164
* Pass source locations of identifiers referenced by @class through ↵Ted Kremenek2009-11-171-2/+3
| | | | | | Action::ActOnForwardClassDeclaration(). llvm-svn: 89162
OpenPOWER on IntegriCloud