summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaTemplate.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Introduce a bit into Type that keeps track of whether there are anyDouglas Gregor2010-10-131-1/+1
| | | | | | | | | | | unnamed or local types within that type. This bit is cached along with the linkage of a type, so that it can be recomputed (e.g., when we see that a typedef has given a name to an anonymous declaration). Use this bit when checking C++03 [temp.arg.type]p2, so that we don't walk template argument types repeatedly. llvm-svn: 116413
* Eliminates a clang warning.Fariborz Jahanian2010-10-131-0/+1
| | | | llvm-svn: 116408
* Teach the warning about unnamed/local types in template arguments toDouglas Gregor2010-10-131-25/+220
| | | | | | | actually walk the template argument type to find any unnamed/local types within it. Fixes PR6784. llvm-svn: 116382
* Introduce support for emitting diagnostics (warnings + their notes)Douglas Gregor2010-10-121-0/+3
| | | | | | | | | | | | | | | that are suppressed during template argument deduction. This change queues diagnostics computed during template argument deduction. Then, if the resulting function template specialization or partial specialization is chosen by overload resolution or partial ordering (respectively), we will emit the queued diagnostics at that point. This addresses most of PR6784. However, the check for unnamed/local template arguments (which existed before this change) is still only skin-deep, and needs to be extended to look deeper into types. It must be improved to finish PR6784. llvm-svn: 116373
* Handle dependent friends more explicitly and deal with the possibilityJohn McCall2010-10-121-1/+11
| | | | | | | | of templated-scope friends by marking them invalid and white-listing all accesses until such time as we implement them. Fixes a crash, this time without a broken test case. llvm-svn: 116364
* Implement C++0x scoped enumerations, from Daniel Wallin! (and tweaked aDouglas Gregor2010-10-081-1/+2
| | | | | | bit by me). llvm-svn: 116122
* Parentheses around address non-type template argument is demoted to an ↵Abramo Bagnara2010-09-131-8/+12
| | | | | | extension warning. llvm-svn: 113739
* When diagnosing C++ [temp.expl.spec]p3 in C++98/03 mode, downgrade theDouglas Gregor2010-09-121-5/+11
| | | | | | | | | | | error to a warning if we're in a case that would be allowed in C++0x. This "fixes" PR8084 by making Clang accept more code than GCC and (non-strict) EDG do. Also, add the missing test case for the C++0x semantics, which should have been in r113717. llvm-svn: 113718
* Implement C++0x semantics for [temp.expl.spec]p2, which loosens theDouglas Gregor2010-09-121-4/+13
| | | | | | | restrictions on out-of-line specializations to allow them anywhere in an enclosing context. Motivated by PR8084. llvm-svn: 113717
* Allow anonymous and local types. The support was already in place for these,Chandler Carruth2010-09-031-21/+23
| | | | | | but this makes them work even as an extension in C++98. This resolves PR8077. llvm-svn: 113011
* Implement basic support for indexing function templates inDouglas Gregor2010-08-311-1/+2
| | | | | | | | | | | | | | libclang. This includes: - Cursor kind for function templates, with visitation logic - Cursor kinds for template parameters, with visitation logic - Visitation logic for template specialization types, qualified type locations - USR generation for function templates, template specialization types, template parameter types. Also happens to fix PR7804, which I tripped across while testing. llvm-svn: 112604
* Add a forgotten place where the enclosing namespace set matters, plus a big ↵Sebastian Redl2010-08-311-2/+2
| | | | | | testcase for inline namespace fun. llvm-svn: 112565
* Rename DeclContext::getLookupContext to getRedeclContext and change its ↵Sebastian Redl2010-08-311-16/+17
| | | | | | semantics slightly. No functionality change in the absence of inline namespaces. Also, change a few places where inline namespaces actually make a difference to be prepared for them. llvm-svn: 112563
* If filtering a lookup result leaves it ambiguous, keep the ambiguity John McCall2010-08-281-1/+6
| | | | | | kind. Fixes PR7252. llvm-svn: 112383
* Fix the memory leak of FloatingLiteral/IntegerLiteral.Argyrios Kyrtzidis2010-08-281-1/+1
| | | | | | | | | | | For large floats/integers, APFloat/APInt will allocate memory from the heap to represent these numbers. Unfortunately, when we use a BumpPtrAllocator to allocate IntegerLiteral/FloatingLiteral nodes the memory associated with the APFloat/APInt values will never get freed. I introduce the class 'APNumericStorage' which uses ASTContext's allocator for memory allocation and is used internally by FloatingLiteral/IntegerLiteral. Fixes rdar://7637185 llvm-svn: 112361
* One who seeks knowledge learns something new every day.John McCall2010-08-261-16/+16
| | | | | | | | | One who seeks the Tao unlearns something new every day. Less and less remains until you arrive at non-action. When you arrive at non-action, nothing will be left undone. llvm-svn: 112244
* Split out a header to hold APIs meant for the Sema implementation from Sema.h.John McCall2010-08-251-1/+1
| | | | | | | Clients of Sema don't need to know (for example) the list of diagnostics we support. llvm-svn: 112093
* GCC didn't care for my attempt at API compatibility, so brute-force everythingJohn McCall2010-08-251-9/+8
| | | | | | to the new constants. llvm-svn: 112047
* Support explicit instantiation of function templates and members of classChandler Carruth2010-08-251-4/+2
| | | | | | | | | | | | | templates when only the declaration is in scope. This requires deferring the instantiation to be lazy, and ensuring the definition is required for that translation unit. We re-use the existing pending instantiation queue, previously only used to track implicit instantiations which were required to be lazy. Fixes PR7979. A subsequent change will rename *PendingImplicitInstantiations to *PendingInstatiations for clarity given its broader role. llvm-svn: 112037
* Move more stuff out of Sema.h.John McCall2010-08-251-0/+2
| | | | llvm-svn: 112026
* More header elimination. The goal of all this is to allow Parser toJohn McCall2010-08-241-0/+1
| | | | | | | #include Sema.h while keeping all the AST declarations opaque. That may not be reasonably attainable, though. llvm-svn: 111907
* Struggle mightily against header inclusion in Sema.h.John McCall2010-08-241-0/+1
| | | | llvm-svn: 111904
* OwningExprResult -> ExprResult. This patch brought to you byJohn McCall2010-08-241-12/+12
| | | | | | | M-x query-replace-regexp \(Sema::\|Action::\|Parser::\|\)Owning\(Expr\|Stmt\)Result -> \2Result llvm-svn: 111903
* Abstract out passing around types and kill off ActionBase.John McCall2010-08-241-12/+18
| | | | llvm-svn: 111901
* Kill off ExprArg (now just Expr*) and StmtArg (now just Stmt*).John McCall2010-08-231-6/+7
| | | | llvm-svn: 111863
* Push DeclGroupRefs and TemplateNames in an opaque but type-safe wayJohn McCall2010-08-231-2/+1
| | | | | | through the parser. llvm-svn: 111800
* DeclPtrTy -> Decl *John McCall2010-08-211-65/+63
| | | | llvm-svn: 111733
* Another step in the process of making the parser depend on Sema:John McCall2010-08-201-2/+2
| | | | | | | | | - move DeclSpec &c into the Sema library - move ParseAST into the Parse library Reflect this change in a thousand different includes. Reflect this change in the link orders. llvm-svn: 111667
* Revert r111609, which is failing its new test.Douglas Gregor2010-08-201-10/+1
| | | | llvm-svn: 111611
* Detect efforts to declare a template member friend and explicitly ignore them.John McCall2010-08-201-1/+10
| | | | | | Avoids a crash. llvm-svn: 111609
* Generate Attr subclasses with TableGen.Alexis Hunt2010-08-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Now all classes derived from Attr are generated from TableGen. Additionally, Attr* is no longer its own linked list; SmallVectors or Attr* are used. The accompanying LLVM commit contains the updates to TableGen necessary for this. Some other notes about newly-generated attribute classes: - The constructor arguments are a SourceLocation and a Context&, followed by the attributes arguments in the order that they were defined in Attr.td - Every argument in Attr.td has an appropriate accessor named getFoo, and there are sometimes a few extra ones (such as to get the length of a variadic argument). Additionally, specific_attr_iterator has been introduced, which will iterate over an AttrVec, but only over attributes of a certain type. It can be accessed through either Decl::specific_attr_begin/end or the global functions of the same name. llvm-svn: 111455
* Commit improved version of 111026 & 111027.Argyrios Kyrtzidis2010-08-151-1/+5
| | | | | | | | | | | | | | | | | | | | Unused warnings for functions: -static functions -functions in anonymous namespace -class methods in anonymous namespace -class method specializations in anonymous namespace -function specializations in anonymous namespace Unused warnings for variables: -static variables -variables in anonymous namespace -static data members in anonymous namespace -static data members specializations in anonymous namespace Reveals lots of opportunities for dead code removal in llvm codebase that will interest my esteemed colleagues. llvm-svn: 111086
* Work around a crash when checking access to injected class namesJohn McCall2010-08-131-2/+7
| | | | | | | | | | qua templates. The current fix suppresses the access check entirely in this case; to do better, we'd need to be able to say that a particular lookup result came from a particular injected class name, which is not easy to do with the current representation of LookupResult. This is on my known-problems list. llvm-svn: 111009
* Perform access control when template lookup finds a class template.John McCall2010-08-131-4/+11
| | | | | | This is *really* hacky. llvm-svn: 110997
* Move Sema's headers into include/clang/Sema, renaming a few along the way.Douglas Gregor2010-08-121-2/+2
| | | | llvm-svn: 110945
* Added locations and type source info for DeclarationName.Abramo Bagnara2010-08-111-23/+26
| | | | llvm-svn: 110860
* Random temporary string cleanup.Benjamin Kramer2010-08-111-1/+1
| | | | llvm-svn: 110807
* Fixed redundant NNS loading.Abramo Bagnara2010-08-101-4/+6
| | | | llvm-svn: 110677
* Template keyword should not be ignored building a QualifiedTemplateName.Abramo Bagnara2010-08-061-3/+5
| | | | llvm-svn: 110441
* Get rid of isObjectType; when C++ says "object type", it generallyEli Friedman2010-08-051-5/+3
| | | | | | | just means "not a function type", not "not a function type or void". This changes behavior slightly, but generally in a way which accepts more code. llvm-svn: 110303
* Don't set out-of-line template specialization/definition informationDouglas Gregor2010-07-281-2/+2
| | | | | | | for AST nodes that aren't actually out-of-line (i.e., require a nested-name-specifier). Fixes <rdar://problem/8204126>. llvm-svn: 109704
* Enable expression transformations in the current-instantiationDouglas Gregor2010-07-281-9/+0
| | | | | | | rebuilder, i.e., remove a silly short-sighted hack from long ago. Thanks to Abramo Bagnara for the test case/bug report! llvm-svn: 109583
* Remove the vast majority of the Destroy methods from the AST library,Douglas Gregor2010-07-251-2/+0
| | | | | | since we aren't going to be calling them ever. llvm-svn: 109377
* Hide the specializations folding sets of ClassTemplateDecl as an ↵Argyrios Kyrtzidis2010-07-201-51/+19
| | | | | | | | | | | | | implementation detail (InsertPos leaks though) and add methods to its interface for adding/finding specializations. Simplifies its users a bit and we no longer need to replace specializations in the folding set with their redeclarations. We just return the most recent redeclarations. As a bonus, it fixes http://llvm.org/PR7670. llvm-svn: 108832
* Update ImplicitCastExpr to be able to represent an XValue.Sebastian Redl2010-07-201-4/+2
| | | | llvm-svn: 108807
* When performing template name lookup for a dependent member accessDouglas Gregor2010-07-161-5/+5
| | | | | | | | | expression such as the "foo" in "this->blah.foo<1, 2>", and we can't look into the type of "this->blah" (e.g., because it is dependent), look into the local scope of a template of the same name. Fixes <rdar://problem/8198511>. llvm-svn: 108531
* When there are extra or missing template parameter lists in a templateDouglas Gregor2010-07-141-3/+16
| | | | | | | | | | definition, we're likely going to end up breaking the invariants of the template system, e.g., that the depths of template parameter lists match up with the nesting template of the template. So, make sure we mark such ill-formed declarations as invalid or don't even build them at all. llvm-svn: 108372
* Provide a special diagnostic for attempts to explicitly specializeDouglas Gregor2010-07-131-6/+16
| | | | | | | | class templates within class scope (which is ill-formed), and recover by dropping the explicit specialization entirely. Fixes the infinite loop in PR7622. llvm-svn: 108217
* When performing substitution of template arguments within the body ofDouglas Gregor2010-07-081-1/+1
| | | | | | | a template, be sure to include the template arguments from the injected-class-name. Fixes PR7587. llvm-svn: 107895
* Correctly set the location of the "template" keyword for a classDouglas Gregor2010-07-061-1/+2
| | | | | | template specialization, from Peter Collingbourne. llvm-svn: 107682
OpenPOWER on IntegriCloud