summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaTemplate.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Added ParenType type node.Abramo Bagnara2010-12-101-3/+1
| | | | llvm-svn: 121488
* It's kindof silly that ExtQuals has an ASTContext&, and we can use thatJohn McCall2010-12-101-2/+2
| | | | | | | | | | space better. Remove this reference. To make that work, change some APIs (most importantly, getDesugaredType()) to take an ASTContext& if they need to return a QualType. Simultaneously, diminish the need to return a QualType by introducing some useful APIs on SplitQualType, which is just a std::pair<const Type *, Qualifiers>. llvm-svn: 121478
* A typename specifier can end up referring to a unresolved usingDouglas Gregor2010-12-091-1/+18
| | | | | | | | declaration that is a value in ill-formed code. Instead of crashing, treat this as a dependent typename specifier and suggest that the using add "typename" into the using declaration. Fixes <rdar://problem/8740998>. llvm-svn: 121322
* PR5207: Change APInt methods trunc(), sext(), zext(), sextOrTrunc() andJay Foad2010-12-071-1/+1
| | | | | | | | zextOrTrunc(), and APSInt methods extend(), extOrTrunc() and new method trunc(), to be const and to return a new value instead of modifying the object in place. llvm-svn: 121121
* Added struct/class syntactic info for c++0x scoped enum.Abramo Bagnara2010-12-031-1/+1
| | | | llvm-svn: 120828
* A few tweaks to the value-kind computation:John McCall2010-11-231-1/+9
| | | | | | | | | | | | | - Default argument expressions pick up the value kind of the incoming expression, not the value kind of the parameter it initializes. - When building a template argument for substitution, A::x is an rvalue if x is an instance method. - Anonymous struct/union paths pick up value kind the same way that normal member accesses do; extract out a common code path for this. Enable the value-kind assertion, now that it passes self-host. llvm-svn: 120055
* In some situations, TemplateArgumentLoc wasn't setting TypeSourceLoc (seeCraig Silverstein2010-11-181-3/+8
| | | | | | | | | http://llvm.org/bugs/show_bug.cgi?id=8558). This patch fixes it. Thanks to rjmccall for all the coaching! Approved by rjmccall llvm-svn: 119697
* Calculate the value kind of an expression when it's created andJohn McCall2010-11-181-7/+13
| | | | | | | | | | | | | store it on the expression node. Also store an "object kind", which distinguishes ordinary "addressed" l-values (like variable references and pointer dereferences) and bitfield, @property, and vector-component l-values. Currently we're not using these for much, but I aim to switch pretty much everything calculating l-valueness over to them. For now they shouldn't necessarily be trusted. llvm-svn: 119685
* Assorted work leading towards the elimination of CK_Unknown.John McCall2010-11-151-1/+4
| | | | llvm-svn: 119138
* Diagnose attempst to template using declarations and using directives.John McCall2010-11-101-0/+8
| | | | | | Recover from the latter and fail early for the former. Fixes PR8022. llvm-svn: 118669
* Remove broken support for variadic templates, along with the variousDouglas Gregor2010-11-071-79/+65
| | | | | | | | | | | | | abstractions (e.g., TemplateArgumentListBuilder) that were designed to support variadic templates. Only a few remnants of variadic templates remain, in the parser (parsing template type parameter packs), AST (template type parameter pack bits and TemplateArgument::Pack), and Sema; these are expected to be used in a future implementation of variadic templates. But don't get too excited about that happening now. llvm-svn: 118385
* No really, we don't have a retain/release system for statements/expressionsJohn McCall2010-10-261-3/+3
| | | | | | anymore. llvm-svn: 117357
* Diagnose the declaration of template template parameters thatDouglas Gregor2010-10-211-1/+6
| | | | | | | | themselves have no template parameters. This is actually a restriction due to the grammar of template template parameters, but we choose to diagnose it in Sema to provide better recovery. llvm-svn: 117032
* When matching template parameter lists to template-ids in a scope specifierJohn McCall2010-10-201-18/+98
| | | | | | | on a friend declaration, skip template-ids which do not depend on the current parameter list. llvm-svn: 116911
* White-listing templated-scope friend decls is a good idea, but doing itJohn McCall2010-10-161-11/+1
| | | | | | | | by marking the decl invalid isn't. Make some steps towards supporting these and then hastily shut them down at the last second by marking them as unsupported. llvm-svn: 116661
* 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
OpenPOWER on IntegriCloud