summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.cpp
Commit message (Collapse)AuthorAgeFilesLines
* DeclaratorInfo -> TypeSourceInfo. Makes an effort to rename associated ↵John McCall2009-12-071-40/+40
| | | | | | | | | | | | | | | | | | | | | variables, but the results are imperfect. For posterity, I did: cat <<EOF > $cmdfile s/DeclaratorInfo/TypeSourceInfo/g s/DInfo/TInfo/g s/TypeTypeSourceInfo/TypeSourceInfo/g s/SourceTypeSourceInfo/TypeSourceInfo/g EOF find lib -name '*.cpp' -not -path 'lib/Parse/*' -exec sed -i '' -f $cmdfile '{}' \; find lib -name '*.h' -exec sed -i '' -f $cmdfile '{}' \; find include -name '*.h' -not -path 'include/clang/Parse/*' -not -path 'include/clang/Basic/*' -exec sed -i '' -f $cmdfile '{}' \; llvm-svn: 90743
* Move RequireCompleteType requirement for fields early into ActOnField so thatEli Friedman2009-12-071-7/+14
| | | | | | subsequent code which depends on a complete type does the right thing. llvm-svn: 90727
* remove some extraneous syntax: sourceloc implicitly converts to sourcerange.Chris Lattner2009-12-061-3/+3
| | | | llvm-svn: 90710
* Pass the desired vtable linkage to GenerateVtable directly. Only call ↵Anders Carlsson2009-12-061-1/+3
| | | | | | MaybeMarkVirtualImplicitMembersReferenced for non-inline functions. llvm-svn: 90686
* Diagnose declarations of implicit member functions.Anders Carlsson2009-12-041-25/+55
| | | | llvm-svn: 90605
* Make sure that overridden method decls are always canonical.Anders Carlsson2009-12-041-1/+1
| | | | llvm-svn: 90542
* When recovering from an invalid forward reference to an enum type in C++,John McCall2009-12-041-2/+6
| | | | | | create the enum type in the same scope as you would a record type. llvm-svn: 90500
* A new helper function to set various bits in the class whenFariborz Jahanian2009-12-031-8/+1
| | | | | | | a new virtual function is declared/instantiated. it is used in couple of places. llvm-svn: 90470
* Unify the end-of-class code paths used by the parser and templateDouglas Gregor2009-12-031-6/+12
| | | | | | | | | | | | | | 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
* In Sema, whenever we think that a function is going to cause a vtable to be ↵Anders Carlsson2009-12-021-3/+5
| | | | | | 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-5/+2
| | | | | | | LookupResult::getAsSingleDecl() is no more. Shift Sema::LookupSingleName to return null on overloaded results. llvm-svn: 90309
* Push overloaded function templates through the parser using a totally differentJohn McCall2009-12-021-7/+2
| | | | | | | leaked data structure than before. This kills off the last remaining explicit uses of OverloadedFunctionDecl in Sema. llvm-svn: 90306
* Fix another "operator delete missing" crash: make sure we don't checkEli Friedman2009-12-021-2/+6
| | | | | | | isVirtual() before we've actually calculated whether the destructor is virtual. llvm-svn: 90303
* Funtion templates and function template specializations do notDouglas Gregor2009-12-011-2/+5
| | | | | | | override virtual functions. Also, eliminate a (now redundant) call to AddOverriddenMethods. llvm-svn: 90242
* Move the checking of overridden virtual functions into the code pathDouglas Gregor2009-12-011-16/+9
| | | | | | | | | | | | | | | 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
* An inherited virtual (where "virtual" wasn't written explicitly) canDouglas Gregor2009-12-011-1/+1
| | | | | | be defined as pure. Fixes PR5656. llvm-svn: 90237
* Remove all of Sema's explicit uses of OverloadedFunctionDecl except forJohn McCall2009-11-301-36/+0
| | | | | | those associated with TemplateNames. llvm-svn: 90162
* Eliminate the use of OverloadedFunctionDecl in member expressions.John McCall2009-11-301-1/+1
| | | | | | | | 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
* Use StringRef in Attr constructors.Benjamin Kramer2009-11-301-4/+2
| | | | llvm-svn: 90140
* Add DeclarationName support for C++0x operator literals. They should now work asAlexis Hunt2009-11-291-1/+2
| | | | | | | function names outside of templates - they'll probably cause some damage there as they're largely untested. llvm-svn: 90064
* Fix 80-cols violationsAlexis Hunt2009-11-291-3/+3
| | | | llvm-svn: 90057
* Add Parser support for C++0x literal operators ('operator "" i').Alexis Hunt2009-11-281-1/+4
| | | | | | DeclarationName can't handle them yet, so right now Parser just errors out on them. llvm-svn: 90027
* Fix thinko.Anders Carlsson2009-11-271-2/+1
| | | | llvm-svn: 89983
* Correctly find overridden destructors.Anders Carlsson2009-11-261-2/+15
| | | | llvm-svn: 89966
* Allow user re-definition of SEL as well as accessing its fields.Fariborz Jahanian2009-11-251-1/+1
| | | | | | This fixes pr5611. llvm-svn: 89895
* Diagnose ill-formed uses of default template arguments inDouglas Gregor2009-11-251-0/+10
| | | | | | | | | | | 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
* Encapsulate "an array of TemplateArgumentLocs and two angle bracket ↵John McCall2009-11-231-7/+5
| | | | | | | | | | locations" into a new class. Use it pervasively throughout Sema. My fingers hurt. llvm-svn: 89638
* This patch implements objective-c's 'SEL' type as a built-inFariborz Jahanian2009-11-211-1/+3
| | | | | | | | | | | | | | | | | | type and fixes a long-standing code gen. crash reported in at least two PRs and a radar. (radar 7405040 and pr5025). There are couple of remaining issues that I would like for Ted. and Doug to look at: Ted, please look at failure in Analysis/MissingDealloc.m. I have temporarily added an expected-warning to make the test pass. This tests has a declaration of 'SEL' type which may not co-exist with the new changes. Doug, please look at a FIXME in PCHWriter.cpp/PCHReader.cpp. I think the changes which I have ifdef'ed out are correct. They need be considered for in a few Indexer/PCH test cases. llvm-svn: 89561
* Added rudimentary C++0x attribute support.Alexis Hunt2009-11-211-2/+2
| | | | | | | | | | | | | | 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
* Implement C++ [basic.lookup.classref]p3, which states how the typeDouglas Gregor2009-11-201-22/+59
| | | | | | | | | | | | 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
* Overhaul previous-declaration and overload checking to work on lookup resultsJohn McCall2009-11-181-170/+247
| | | | | | | rather than NamedDecl*. This is a major step towards eliminating OverloadedFunctionDecl. llvm-svn: 89263
* Track overriding methods when instantiating a template class. Fixes PR5550.Sebastian Redl2009-11-181-18/+22
| | | | llvm-svn: 89248
* Split LookupResult into its own header.John McCall2009-11-181-9/+9
| | | | llvm-svn: 89199
* Incremental progress on using declarations. Split UnresolvedUsingDecl intoJohn McCall2009-11-181-1/+8
| | | | | | | | | | 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
* Unify the way destructor epilogues are generated for synthesized and regular ↵Anders Carlsson2009-11-171-1/+1
| | | | | | destructors. Also fix PR5529. llvm-svn: 89034
* Carry lookup configuration throughout lookup on the LookupResult. GiveJohn McCall2009-11-171-36/+44
| | | | | | | | | | | | | LookupResult RAII powers to diagnose ambiguity in the results. Other diagnostics (e.g. access control and deprecation) will be moved to automatically trigger during lookup as part of this same mechanism. This abstraction makes it much easier to encapsulate aliasing declarations (e.g. using declarations) inside the lookup system: eventually, lookup will just produce the aliases in the LookupResult, and the standard access methods will naturally strip the aliases off. llvm-svn: 89027
* First part of changes to eliminate problems with cv-qualifiers andDouglas Gregor2009-11-161-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sugared types. The basic problem is that our qualifier accessors (getQualifiers, getCVRQualifiers, isConstQualified, etc.) only look at the current QualType and not at any qualifiers that come from sugared types, meaning that we won't see these qualifiers through, e.g., typedefs: typedef const int CInt; typedef CInt Self; Self.isConstQualified() currently returns false! Various bugs (e.g., PR5383) have cropped up all over the front end due to such problems. I'm addressing this problem by splitting each qualifier accessor into two versions: - the "local" version only returns qualifiers on this particular QualType instance - the "normal" version that will eventually combine qualifiers from this QualType instance with the qualifiers on the canonical type to produce the full set of qualifiers. This commit adds the local versions and switches a few callers from the "normal" version (e.g., isConstQualified) over to the "local" version (e.g., isLocalConstQualified) when that is the right thing to do, e.g., because we're printing or serializing the qualifiers. Also, switch a bunch of Context.getCanonicalType(T1).getUnqualifiedType() == Context.getCanonicalType(T2).getQualifiedType() expressions over to Context.hasSameUnqualifiedType(T1, T2) llvm-svn: 88969
* Make sure that virtual destructors have delete operators.Anders Carlsson2009-11-151-2/+9
| | | | llvm-svn: 88877
* Deallocation functions must also be static.Anders Carlsson2009-11-151-1/+7
| | | | llvm-svn: 88859
* allocation functions are always static.Anders Carlsson2009-11-151-1/+10
| | | | llvm-svn: 88858
* If any errors have occurred by the time we hit the end of a function body, ↵Douglas Gregor2009-11-151-0/+6
| | | | | | clear out any remaining temporaries so they aren't seen later. llvm-svn: 88834
* Fix for PR5489: don't skip the complete type requrirement for variableEli Friedman2009-11-141-2/+7
| | | | | | definitions just because the type happens to be an array type. llvm-svn: 88752
* Revert r88718, which does NOT solve the ↵Douglas Gregor2009-11-131-3/+0
| | | | | | constructor-template-as-copy-constructor issue. Big thanks to John for finding this llvm-svn: 88724
* A constructor template cannot be instantiated to a copyDouglas Gregor2009-11-131-0/+3
| | | | | | constructor. Make sure that such declarations can never be formed. llvm-svn: 88718
* Fix bug Doug noticed.Anders Carlsson2009-11-131-0/+2
| | | | llvm-svn: 88679
* Random const correctness, and incidentally use computeDeclContext when buildingJohn McCall2009-11-121-1/+1
| | | | | | a using declaration. llvm-svn: 86942
* Improve parsing of template arguments to lay the foundation forDouglas Gregor2009-11-101-3/+2
| | | | | | | | | | | | | | | | | | | | | | handling template template parameters properly. This refactoring: - Parses template template arguments as id-expressions, representing the result of the parse as a template name (Action::TemplateTy) rather than as an expression (lame!). - Represents all parsed template arguments via a new parser-specific type, ParsedTemplateArgument, which stores the kind of template argument (type, non-type, template) along with all of the source information about the template argument. This replaces an ad hoc set of 3 vectors (one for a void*, which was either a type or an expression; one for a bit telling whether the first was a type or an expression; and one for a single source location pointing at the template argument). - Moves TemplateIdAnnotation into the new Parse/Template.h. It never belonged in the Basic library anyway. llvm-svn: 86708
* Make sure that Type::getAs<ArrayType>() (or Type::getAs<subclass ofDouglas Gregor2009-11-091-1/+1
| | | | | | | ArrayType>()) does not instantiate. Update all callers that used this unsafe feature to use the appropriate ASTContext::getAs*ArrayType method. llvm-svn: 86596
* When checking the namespace of a redeclaration or definition, look through ↵Sebastian Redl2009-11-081-11/+16
| | | | | | linkage specs. Fixes PR5430. llvm-svn: 86461
* Don't treat variables with non-trivial ctors or dtors as unused. Fixes PR5407.Anders Carlsson2009-11-071-2/+16
| | | | llvm-svn: 86352
OpenPOWER on IntegriCloud