summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Variable templates: handle instantiation of static data member templatesRichard Smith2013-09-271-98/+162
| | | | | | appropriately, especially when they appear within class templates. llvm-svn: 191548
* If a partial specialization of a member template is declared within a classRichard Smith2013-09-261-2/+2
| | | | | | | | | template and defined outside it, don't instantiate it twice when instantiating the surrounding class template specialization. That would cause us to reject the code because we think two partial specializations instantiated to produce the same signature. llvm-svn: 191418
* Revert change accidentally committed in r191150.Richard Smith2013-09-231-3/+1
| | | | llvm-svn: 191237
* PR17295: Do not allow explicit conversion functions to be used in cases whereRichard Smith2013-09-211-1/+3
| | | | | | | | | | an additional conversion (other than a qualification conversion) would be required after the explicit conversion. Conversely, do allow explicit conversion functions to be used when initializing a temporary for a reference binding in direct-list-initialization. llvm-svn: 191150
* Switch the semantic DeclContext for a block-scope declaration of a function orRichard Smith2013-09-201-22/+45
| | | | | | | | | | | | | | variable from being the function to being the enclosing namespace scope (in C++) or the TU (in C). This allows us to fix a selection of related issues where we would build incorrect redeclaration chains for such declarations, and fail to notice type mismatches. Such declarations are put into a new IdentifierNamespace, IDNS_LocalExtern, which is only found when searching scopes, and not found when searching DeclContexts. Such a declaration is only made visible in its DeclContext if there are no non-LocalExtern declarations. llvm-svn: 191064
* Revert "Revert "[-cxx-abi microsoft] Mangle local TagDecls appropriately""David Majnemer2013-09-171-0/+13
| | | | | | This reverts commit r190895 which reverted r190892. llvm-svn: 190904
* Revert "[-cxx-abi microsoft] Mangle local TagDecls appropriately"David Majnemer2013-09-171-13/+0
| | | | | | This reverts commit r190892. llvm-svn: 190895
* [-cxx-abi microsoft] Mangle local TagDecls appropriatelyDavid Majnemer2013-09-171-0/+13
| | | | | | | | | | | | | | | | | | | | | | | Summary: When selecting a mangling for an anonymous tag type: - We should first try it's typedef'd name. - If that doesn't work, we should mangle in the name of the declarator that specified it as a declaration specifier. - If that doesn't work, fall back to a static mangling of <unnamed-type>. This should make our anonymous type mangling compatible. This partially fixes PR16994; we would need to have an implementation of scope numbering to get it right (a separate issue). Reviewers: rnk, rsmith, rjmccall, cdavis5x CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1540 llvm-svn: 190892
* Note when a decl is used in AST files.Eli Friedman2013-09-051-1/+1
| | | | | | | | | | | | | | | When an AST file is built based on another AST file, it can use a decl from the fist file, and therefore mark the "isUsed" bit. We need to note this in the AST file so that the bit is set correctly when the second AST file is loaded. This patch introduces the distinction between setIsUsed() and markUsed() so that we don't call into the ASTMutationListener callback when it wouldn't be appropriate. Fixes PR16635. llvm-svn: 190016
* Sema: Subst type default template args earlierDavid Majnemer2013-08-281-4/+27
| | | | | | | | | | | | | | | | | Summary: We would not perform substitution at an appropriate point, allowing strange results to appear. We would accepts things that we shouldn't or mangle things incorrectly. Note that this hasn't fixed the other cases like template-template parameters or non-type template parameters. Reviewers: doug.gregor, rjmccall, rsmith Reviewed By: rsmith CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1507 llvm-svn: 189540
* Remove SequenceNumber from class/variable template partial specializations.Richard Smith2013-08-221-4/+2
| | | | | | | | This was only used to ensure that the traversal order was the same as the insertion order, but that guarantee was already being provided by the use of a FoldingSetVector. llvm-svn: 189075
* Refactor for clarity and simplicity.Larisse Voufo2013-08-221-15/+13
| | | | llvm-svn: 188974
* Improve support for static data member templates. This revision still has at ↵Larisse Voufo2013-08-221-21/+16
| | | | | | least one bug, as it does not respect the variable template specialization hierarchy well. llvm-svn: 188969
* Parse: Do not 'HandleTopLevelDecl' on templated functions.David Majnemer2013-08-161-1/+1
| | | | | | | | | | | | | | | | Summary: HandleTopLevelDecl on a templated function leads us to try and mangle it. Reviewers: rsmith Reviewed By: rsmith CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1412 llvm-svn: 188536
* PR16875: The return type of a dependent function type is visible when it'sRichard Smith2013-08-141-1/+1
| | | | | | | | | | | referenced as a member of the current instantiation. In that case, deduce the type of the function to a dependent type rather than exposing an undeduced auto type to the rest of the current instantiation. The standard doesn't really say that the type is dependent in this case; I'll bring this up with CWG. llvm-svn: 188410
* Bug fix: disallow a variable template to be redeclared as a non-templated ↵Larisse Voufo2013-08-141-1/+1
| | | | | | variable llvm-svn: 188350
* Fix implementation of C11 6.2.7/4 and C++11 [dcl.array]p3:Richard Smith2013-08-131-5/+13
| | | | | | | | | | | | | When a local extern declaration redeclares some other entity, the type of that entity is merged with the prior type if the prior declaration is visible (in C) or is declared in the same scope (in C++). - Make LookupRedeclarationWithLinkage actually work in C++, use it in the right set of cases, and make it track whether it found a shadowed declaration. - Track whether we found a declaration in the same scope (for C++) including across serialization and template instantiation. llvm-svn: 188307
* variable templates updated for PCH serialization... Still working on test ↵Larisse Voufo2013-08-131-3/+14
| | | | | | cases... llvm-svn: 188249
* Fix to PR16225 (Assert-on-invalid: isa<LabelDecl>(D) && "declaration not ↵Serge Pavlov2013-08-101-0/+3
| | | | | | | | instantiated in this scope") Differential Revision: http://llvm-reviews.chandlerc.com/D920 llvm-svn: 188137
* Added source locs for angled parentheses in class/var template partial specs.Enea Zaffanella2013-08-101-6/+12
| | | | llvm-svn: 188134
* PR9992: Serialize and deserialize the token sequence for a function template inRichard Smith2013-08-071-1/+7
| | | | | | -fdelayed-template-parsing mode. Patch by Will Wilson! llvm-svn: 187916
* Fixing commit r187768: Moved diagnosis of forward declarations of variable ↵Larisse Voufo2013-08-061-0/+1
| | | | | | templates from Parser to Sema. llvm-svn: 187770
* Moved diagnosis of forward declarations of variable templates from Parser to ↵Larisse Voufo2013-08-061-1/+0
| | | | | | Sema. llvm-svn: 187768
* SemaTemplateInstantiateDecl.cpp: Suppress a warning. [-Wunused-variable]NAKAMURA Takumi2013-08-061-0/+1
| | | | llvm-svn: 187765
* Started implementing variable templates. Top level declarations should be ↵Larisse Voufo2013-08-061-141/+627
| | | | | | fully supported, up to some limitations documented as FIXMEs or TODO. Static data member templates work very partially. Static data member templates of class templates need particular attention... llvm-svn: 187762
* Fix declaring class template methods with an attributed typedefReid Kleckner2013-07-311-52/+38
| | | | | | | | | | | | | | This change unifies the logic for template instantiation of methods and functions declared with typedefs. It ensures that SubstFunctionType() always fills the Params out param with non-null ParmVarDecls or returns null. Reviewers: rsmith Differential Revision: http://llvm-reviews.chandlerc.com/D1135 llvm-svn: 187528
* Improve clarity/consistency of a few UsingDecl methods and related helpers.Enea Zaffanella2013-07-221-5/+5
| | | | | | | | | | | | No functionality change. In Sema helper functions: * renamed isTypeName as HasTypenameKeyword In UsingDecl: * renamed get/setUsingLocation to get/setUsingLoc * renamed is/setTypeName as has/setTypename llvm-svn: 186816
* Fix source range of implicitly instantiated friend declaration.Enea Zaffanella2013-07-191-0/+1
| | | | llvm-svn: 186702
* Reinstate r186040, with additional fixes and more test coverage (reverted inRichard Smith2013-07-171-13/+7
| | | | | | | | | | | | | r186331). Original commit log: If we friend a declaration twice, that should not make it visible to name lookup in the surrounding context. Slightly rework how we handle friend declarations to inherit the visibility of the prior declaration, rather than setting a friend declaration to be visible whenever there was a prior declaration. llvm-svn: 186546
* Re-revert r86040, which was un-reverted in r186199.Chandler Carruth2013-07-151-7/+13
| | | | | | | | | | | | | | | This breaks the build of basic patterns with repeated friend declarations. See the added test case in SemaCXX/friend.cpp or the test case reported to the original commit log. Original commit log: If we friend a declaration twice, that should not make it visible to name lookup in the surrounding context. Slightly rework how we handle friend declarations to inherit the visibility of the prior declaration, rather than setting a friend declaration to be visible whenever there was a prior declaration. llvm-svn: 186331
* Fix to PR12262 - assertion when substituting explicit template argumentsSerge Pavlov2013-07-151-0/+7
| | | | | | | | does not substitute a sizeof-pack expression. The solution is proposed by Richard Smith. Differential Revision: http://llvm-reviews.chandlerc.com/D869 llvm-svn: 186306
* Unrevert r186040, reverted in r186185, with fix for PR16597.Richard Smith2013-07-121-13/+7
| | | | | | | | | | | Original commit log: If we friend a declaration twice, that should not make it visible to name lookup in the surrounding context. Slightly rework how we handle friend declarations to inherit the visibility of the prior declaration, rather than setting a friend declaration to be visible whenever there was a prior declaration. llvm-svn: 186199
* Revert r186040 to fix PR16597 while Richard investigates what the bestChandler Carruth2013-07-121-7/+13
| | | | | | | | | | | | | fix is. Original commit log: If we friend a declaration twice, that should not make it visible to name lookup in the surrounding context. Slightly rework how we handle friend declarations to inherit the visibility of the prior declaration, rather than setting a friend declaration to be visible whenever there was a prior declaration. llvm-svn: 186185
* If we friend a declaration twice, that should not make it visible to nameRichard Smith2013-07-101-13/+7
| | | | | | | | | lookup in the surrounding context. Slightly rework how we handle friend declarations to inherit the visibility of the prior declaration, rather than setting a friend declaration to be visible whenever there was a prior declaration. llvm-svn: 186040
* Fixed comment of Sema::FindInstantiatedDecl.Serge Pavlov2013-07-101-5/+5
| | | | llvm-svn: 185997
* Switch Decl instantiation to DeclNodes.inc.Eli Friedman2013-06-271-2/+41
| | | | | | | | | This replaces a long list of declarations for visitor functions with a list generated from DeclNodes.inc. Nothing really interesting came out of it; we had comprehensive coverage anyway (excluding FriendTemplateDecls). llvm-svn: 185118
* Fix PCH bug with member templates of local classes in nontemplate functions. Faisal Vali2013-06-261-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | As noted by Richard in the post: http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20130624/082605.html, the following code should not add an entry into PendingLocalImplicitInstantiations, since local instantiations should only occur within the context of other instantiations: int foo(double y) { struct Lambda { template<class T> T operator()(T t) const { return t; }; } lambda; return lambda(y); } Hence the attached code does the following: 1) In MarkFunctionReferenced, check if ActiveInstantiations.size() is non-zero before adding to PendingLocalImplicitInstantiations. 2) In InstantiateFunctionDefinition, we swap out/in PendingLocalImplicitInstantiations so that only those pending local instantiations that are added during the instantiation of the current function are instantiated recursively. llvm-svn: 184903
* Include the unexpanded packs in the initializer expression when checking aNick Lewycky2013-06-131-1/+2
| | | | | | pack expanded constructor initializer list. Fixes PR16303! llvm-svn: 183878
* Use FPT::getArgTypes() instead of manually building ArrayRefsReid Kleckner2013-06-101-13/+5
| | | | | | | | Made significantly easier with git-clang-format. Differential Revision: http://llvm-reviews.chandlerc.com/D947 llvm-svn: 183694
* reverted testLarisse Voufo2013-06-101-1/+0
| | | | llvm-svn: 183637
* testLarisse Voufo2013-06-101-0/+1
| | | | llvm-svn: 183636
* PR16243: Use CXXThisOverride during template instantiation, and fix up theRichard Smith2013-06-071-3/+9
| | | | | | | | places which weren't setting it up properly. This allows us to get the right cv-qualifiers for 'this' when it appears outside a method body in a class template. llvm-svn: 183483
* PR15757: When we instantiate an inheriting constructor template, alsoRichard Smith2013-05-171-1/+27
| | | | | | | | | instantiate the inherited constructor template and mark that as the constructor which the instantiated specialization is inheriting. This fixes a crash-on-valid when trying to compute the exception specification of a specialization of the inheriting constructor. llvm-svn: 182072
* OpenMP threadprivate with qualified names.Alexey Bataev2013-05-131-4/+4
| | | | llvm-svn: 181683
* In VarDecl nodes, store the thread storage class specifier as written.Enea Zaffanella2013-05-041-1/+1
| | | | llvm-svn: 181113
* Implement most of N3638 (return type deduction for normal functions).Richard Smith2013-05-041-5/+7
| | | | | | | Missing (somewhat ironically) is support for the new deduction rules in lambda functions, plus PCH support for return type patching. llvm-svn: 181108
* ArrayRef'ize MultiLevelTemplateArgumentList::ArgList. Patch by Faisal Vali!Richard Smith2013-05-031-14/+11
| | | | llvm-svn: 181077
* ArrayRef'ize Sema::ActOnEnumBody. No functionality change.Dmitri Gribenko2013-04-271-1/+1
| | | | | | Patch by Robert Wilhelm. llvm-svn: 180682
* Basic support for Microsoft property declarations andJohn McCall2013-04-161-0/+47
| | | | | | | | references thereto. Patch by Tong Shen! llvm-svn: 179585
* Correctly propagate the storage class to function template instantiations.Rafael Espindola2013-04-161-1/+1
| | | | | | | This fixes pr15753. This is another case of the fuzzy definition of the "as written" storage class of an instantiation. llvm-svn: 179581
OpenPOWER on IntegriCloud