summaryrefslogtreecommitdiffstats
path: root/include/clang/AST/DeclTemplate.h
Commit message (Collapse)AuthorAgeFilesLines
* Add vtable anchor to classes.Richard Trieu2018-12-291-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@350143 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix doxygen comment.Adrian Prantl2018-10-231-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@345071 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix Wdocumentation warning. NFCI.Simon Pilgrim2018-10-121-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344333 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sema] Fix a multiple definition bug with friends and templatesErik Pilkington2018-10-101-0/+3
| | | | | | | | | | | | | | The problem was that MergeFunctionDecl sometimes needs the injected template arguments of a FunctionTemplateDecl, but is called before adding the new template to the redecl chain. This leads to multiple common pointers in the same redecl chain, each with their own identical instantiation. Fix this by merging the the common state before inserting the new template into the redecl chain. rdar://44810129 Differential revision: https://reviews.llvm.org/D53046 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344157 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove trailing spaceFangrui Song2018-07-301-11/+11
| | | | | | sed -Ei 's/[[:space:]]+$//' include/**/*.{def,h,td} lib/**/*.{cpp,h} git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@338291 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix null MSInheritanceAttr deref in CXXRecordDecl::getMSInheritanceModel()Reid Kleckner2018-05-311-8/+2
| | | | | | | | | | | | | | Ensure latest MPT decl has a MSInheritanceAttr when instantiating templates, to avoid null MSInheritanceAttr deref in CXXRecordDecl::getMSInheritanceModel(). See PR#37399 for repo / details. Patch by Andrew Rogers! Differential Revision: https://reviews.llvm.org/D46664 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333680 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove \brief commands from doxygen comments.Adrian Prantl2018-05-091-234/+234
| | | | | | | | | | | | | | | | | | | This is similar to the LLVM change https://reviews.llvm.org/D46290. We've been running doxygen with the autobrief option for a couple of years now. This makes the \brief markers into our comments redundant. Since they are a visual distraction and we don't want to encourage more \brief markers in new code either, this patch removes them all. Patch produced by for i in $(git grep -l '\@brief'); do perl -pi -e 's/\@brief //g' $i & done for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done Differential Revision: https://reviews.llvm.org/D46320 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331834 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert rC330794 and some dependent tiny bug fixes Faisal Vali2018-04-261-40/+0
| | | | | | | | | | | | | | | | | | See Richard's humbling feedback here: http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20180423/226482.html http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20180423/226486.html Wish I'd had the patience to solicit the feedback prior to committing :) Sorry for the noise guys. Thank you Richard for being the steward that clang deserves! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@330888 91177308-0d34-0410-b5e6-96231b3b80d8
* [c++2a] [concepts] Add rudimentary parsing support for template concept ↵Faisal Vali2018-04-251-0/+40
| | | | | | | | | | | | | | | declarations This patch is a tweak of changyu's patch: https://reviews.llvm.org/D40381. It differs in that the recognition of the 'concept' token is moved into the machinery that recognizes declaration-specifiers - this allows us to leverage the attribute handling machinery more seamlessly. See the test file to get a sense of the basic parsing that this patch supports. There is much more work to be done before concepts are usable... Thanks Changyu! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@330794 91177308-0d34-0410-b5e6-96231b3b80d8
* [AST] Fix some Clang-tidy modernize-use-auto warnings; other minor fixes (NFC).Eugene Zelenko2018-03-291-32/+27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@328826 91177308-0d34-0410-b5e6-96231b3b80d8
* D40901: Refactor lazy loading of template specializations. NFCVassil Vassilev2017-12-141-21/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@320763 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove old concepts parsing codeHubert Tong2017-12-071-21/+11
| | | | | | | | | | | | | | | | | | | Summary: This is so we can implement concepts per P0734R0. Relevant failing test cases are disabled. Reviewers: hubert.reinterpretcast, rsmith, saar.raz, nwilson Reviewed By: saar.raz Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D40380 Patch by Changyu Li! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@319992 91177308-0d34-0410-b5e6-96231b3b80d8
* PR35456: Track definedness of variable template specializations separately fromRichard Smith2017-12-021-0/+9
| | | | | | | | | | | whether they have an initializer. We cannot distinguish between a declaration of a variable template specialization and a definition of one that lacks an initializer without this, and would previously mistake the latter for the former. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@319605 91177308-0d34-0410-b5e6-96231b3b80d8
* [AST] Fix some Clang-tidy modernize and Include What You Use warnings; other ↵Eugene Zelenko2017-11-291-201/+220
| | | | | | minor fixes (NFC). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@319376 91177308-0d34-0410-b5e6-96231b3b80d8
* PR32010: Fix template argument depth mixup when forming implicit constructorRichard Smith2017-02-211-0/+1
| | | | | | | | | | | | | | template deduction guides for class template argument deduction. Ensure that we have a local instantiation scope for tracking the instantiated parameters. Additionally, unusually, we're substituting at depth 1 and leaving depth 0 alone; make sure that we don't reduce template parameter depth by 2 for inner parameters in the process. (This is probably also broken for alias templates in the case where they're expanded within a dependent context, but this patch doesn't fix that.) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@295696 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a destruct-on-exit function to ASTContext.George Burgess IV2017-02-141-8/+0
| | | | | | | | | | | | | | | It looks like the only use of AddDeallocation is to indirectly call the destructors of objects. In one case I found (TypeAliasTemplateDecl::Common), the destructor is a nop, so registering it to run later seems pointless. All of the other *::Common types have non-trivial dtors, so deleting the useless AddDeallocation felt somewhat fragile. Happy to kill it + turn the is_trivial_dtor check into a static_assert if people think that'd be better. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@295029 91177308-0d34-0410-b5e6-96231b3b80d8
* [c++1z] Synthesize implicit deduction guides from constructors on demand. RankRichard Smith2017-02-141-0/+1
| | | | | | | | | | | | | | | | | | | | such guides below explicit ones, and ensure that references to the class's template parameters are not treated as forwarding references. We make a few tweaks to the wording in the current standard: 1) The constructor parameter list is copied faithfully to the deduction guide, without losing default arguments or a varargs ellipsis (which the standard wording loses by omission). 2) If the class template declares no constructors, we add a T() -> T<...> guide (which will only ever work if T has default arguments for all non-pack template parameters). 3) If the class template declares nothing that looks like a copy or move constructor, we add a T(T<...>) -> T<...> guide. #2 and #3 follow from the "pretend we had a class type with these constructors" philosophy for deduction guides. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@295007 91177308-0d34-0410-b5e6-96231b3b80d8
* [Concepts] Class template associated constraintsHubert Tong2017-02-101-17/+99
| | | | | | | | | | | | | | | | Summary: This adds associated constraints as a property of class templates. An error is produced if redeclarations are not similarly constrained. Reviewers: rsmith, faisalv, aaron.ballman Reviewed By: rsmith Subscribers: cfe-commits, nwilson Differential Revision: https://reviews.llvm.org/D25674 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@294697 91177308-0d34-0410-b5e6-96231b3b80d8
* Towards P0091R3: parsing support for class template argument deduction in ↵Richard Smith2017-01-301-0/+10
| | | | | | | | | | typename-specifiers. This reinstates r293455, reverted in r293455, with a fix for cv-qualifier handling on dependent typename-specifiers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@293544 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r293455, which breaks v8 with a spurious error. Testcase added.Sam McCall2017-01-301-10/+0
| | | | | | | | | | | | Summary: Revert r293455, which breaks v8 with a spurious error. Testcase added. Reviewers: klimek Subscribers: cfe-commits, rsmith Differential Revision: https://reviews.llvm.org/D29271 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@293473 91177308-0d34-0410-b5e6-96231b3b80d8
* Towards P0091R3: parsing support for class template argument deduction in ↵Richard Smith2017-01-301-0/+10
| | | | | | typename-specifiers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@293455 91177308-0d34-0410-b5e6-96231b3b80d8
* PR31469: Don't add friend template class decls to redecl chain in dependent ↵Vassil Vassilev2017-01-121-2/+1
| | | | | | | | | | | | | | | | | | contexts. Fixes a crash in modules where the template class decl becomes the most recent decl in the redeclaration chain and forcing the template instantiator try to instantiate the friend declaration, rather than the template definition. In practice, A::list<int> produces a TemplateSpecializationType A::__1::list<int, allocator<type-parameter-0-0> >' failing to replace to subsitute the default argument to allocator<int>. Kudos Richard Smith (D28399). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@291753 91177308-0d34-0410-b5e6-96231b3b80d8
* PR12298 et al: don't recursively instantiate a template specialization fromRichard Smith2016-08-311-0/+10
| | | | | | | | | | | | | | | | within the instantiation of that same specialization. This could previously happen for eagerly-instantiated function templates, variable templates, exception specifications, default arguments, and a handful of other cases. We still have an issue here for default template arguments that recursively make use of themselves and likewise for substitution into the type of a non-type template parameter, but in those cases we're producing a different entity each time, so they should instead be caught by the instantiation depth limit. However, currently we will typically run out of stack before we reach it. :( git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@280190 91177308-0d34-0410-b5e6-96231b3b80d8
* [Concepts] remove default argument for RequiresClause; NFCHubert Tong2016-08-031-2/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@277658 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply r276069 with workaround for MSVC 2013Hubert Tong2016-07-301-27/+54
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@277286 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r276069: MSVC bots not happyHubert Tong2016-07-201-50/+27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@276074 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix r276069: add default argument for new parameterHubert Tong2016-07-201-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@276073 91177308-0d34-0410-b5e6-96231b3b80d8
* Concepts: Create space for requires-clause in TemplateParameterList; NFCHubert Tong2016-07-201-27/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Space for storing the //constraint-expression// of the //requires-clause// associated with a `TemplateParameterList` is arranged by taking a bit out of the `NumParams` field for the purpose of determining whether there is a //requires-clause// or not, and by adding to the trailing objects tied to the `TemplateParameterList`. An accessor is provided. An appropriate argument is supplied to `TemplateParameterList::Create` at the various call sites. Serialization changes will addressed as the Concepts implementation becomes more solid. Drive-by fix: This change also replaces the custom `FixedSizeTemplateParameterListStorage` implementation with one that follows the interface provided by `llvm::TrailingObjects`. Reviewers: aaron.ballman, faisalv, rsmith Subscribers: cfe-commits, nwilson Differential Revision: https://reviews.llvm.org/D19322 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@276069 91177308-0d34-0410-b5e6-96231b3b80d8
* [NFC] Header cleanupMehdi Amini2016-07-181-1/+0
| | | | | | | | | | Summary: Removed unused headers, replaced some headers with forward class declarations Patch by: Eugene <claprix@yandex.ru> Differential Revision: https://reviews.llvm.org/D20100 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@275882 91177308-0d34-0410-b5e6-96231b3b80d8
* [AST] Use ArrayRef in more interfacesDavid Majnemer2016-07-061-31/+19
| | | | | | | | ArrayRef is a little better than passing around a pointer/length pair. No functional change is intended. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274601 91177308-0d34-0410-b5e6-96231b3b80d8
* [AST] Use ArrayRef in more interfacesDavid Majnemer2016-07-031-21/+15
| | | | | | | | ArrayRef is a little better than passing around a pointer/length pair. No functional change is intended. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274475 91177308-0d34-0410-b5e6-96231b3b80d8
* [Feature] Add a builtin for indexing into parameter packs. Patch by Louis ↵Eric Fiselier2016-07-011-2/+2
| | | | | | | | | | | | | | | Dionne. This patch adds a __nth_element builtin that allows fetching the n-th type of a parameter pack with very little compile-time overhead. The patch was inspired by r252036 and r252115 by David Majnemer, which add a similar __make_integer_seq builtin for efficiently creating a std::integer_sequence. Reviewed as D15421. http://reviews.llvm.org/D15421 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274316 91177308-0d34-0410-b5e6-96231b3b80d8
* Add some std::move where the value is only read otherwise.Benjamin Kramer2016-06-121-1/+1
| | | | | | This mostly affects smart pointers. No functionality change intended. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@272520 91177308-0d34-0410-b5e6-96231b3b80d8
* Apply clang-tidy's misc-move-constructor-init throughout Clang.Benjamin Kramer2016-05-271-3/+4
| | | | | | No functionality change intended, maybe a tiny performance improvement. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@270996 91177308-0d34-0410-b5e6-96231b3b80d8
* [modules] Enforce the rules that an explicit or partial specialization must beRichard Smith2016-05-051-8/+6
| | | | | | | | | declared before it is used. Because we don't use normal name lookup to find these, the normal code to filter out non-visible names from name lookup results does not apply. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@268585 91177308-0d34-0410-b5e6-96231b3b80d8
* [Concepts] Implement a portion of Concepts TS[dcl.spec.concept]p1 byNathan Wilson2016-02-081-22/+31
| | | | | | | | | | | | | | diagnosing when 'concept' is specified on a function or template specialization. Since a concept can only be applied to a function or variable template, the concept bit is stored in TemplateDecl as a PointerIntPair. Reviewers: rsmith, faisalv, aaron.ballman, hubert.reinterpretcast Differential Revision: http://reviews.llvm.org/D13357 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260074 91177308-0d34-0410-b5e6-96231b3b80d8
* [TrailingObjects] Convert Decl* classes.James Y Knight2015-12-291-4/+3
| | | | | | | | Also remove now-redundant explicit alignment specification on some of the classes converted prior to TrailingObjects automatically ensuring proper alignment. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@256585 91177308-0d34-0410-b5e6-96231b3b80d8
* ArrayRef-ize TemplateParameterList. NFCDavid Majnemer2015-12-271-6/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@256463 91177308-0d34-0410-b5e6-96231b3b80d8
* Deduplicate three identical copies of ↵Yaron Keren2015-11-131-33/+6
| | | | | | isExplicitInstantiationOrSpecialization, NFC. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@253046 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sema] Implement __make_integer_seqDavid Majnemer2015-11-041-0/+30
| | | | | | | | | | | | | | | | | | This new builtin template allows for incredibly fast instantiations of templates like std::integer_sequence. Performance numbers follow: My work station has 64 GB of ram + 20 Xeon Cores at 2.8 GHz. __make_integer_seq<std::integer_sequence, int, 90000> takes 0.25 seconds. std::make_integer_sequence<int, 90000> takes unbound time, it is still running. Clang is consuming gigabytes of memory. Differential Revision: http://reviews.llvm.org/D13786 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@252036 91177308-0d34-0410-b5e6-96231b3b80d8
* Roll-back r250822.Angel Garcia Gomez2015-10-201-1/+1
| | | | | | | | | | Summary: It breaks the build for the ASTMatchers Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D13893 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@250827 91177308-0d34-0410-b5e6-96231b3b80d8
* Apply modernize-use-default to clang.Angel Garcia Gomez2015-10-201-1/+1
| | | | | | | | | | | | Summary: Replace empty bodies of default constructors and destructors with '= default'. Reviewers: bkramer, klimek Subscribers: klimek, alexfh, cfe-commits Differential Revision: http://reviews.llvm.org/D13890 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@250822 91177308-0d34-0410-b5e6-96231b3b80d8
* constify four getInstantiatedFromMemberTemplate() in DeclTemplate.h.Yaron Keren2015-10-021-4/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@249159 91177308-0d34-0410-b5e6-96231b3b80d8
* constify ClassTemplatePartialSpecializationDecl::getInstantiatedFromMember ↵Yaron Keren2015-10-021-4/+4
| | | | | | and VarTemplatePartialSpecializationDecl::getInstantiatedFromMember. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@249152 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix alignment of TemplateArgumentList.James Y Knight2015-08-061-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@244280 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert a few classes over to use the new TrailingObjects helper.James Y Knight2015-08-061-32/+84
| | | | | | | | | | This initial commit serves as an example -- the remainder of the classes using pointer arithmetic for trailing objects will be converted in subsequent changes. Differential Revision: http://reviews.llvm.org/D11298 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@244262 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unused 'Owned' flag from TemplateArgumentList.James Y Knight2015-08-061-14/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@244261 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix alignment issues in Clang.James Y Knight2015-07-171-24/+12
| | | | | | | | | | | | | | | | | Some const-correctness changes snuck in here too, since they were in the area of code I was modifying. This seems to make Clang actually work without Bus Error on 32bit-sparc. Follow-up patches will factor out a trailing-object helper class, to make classes using the idiom of appending objects to other objects easier to understand, and to ensure (with static_assert) that required alignment guarantees continue to hold. Differential Revision: http://reviews.llvm.org/D10272 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@242554 91177308-0d34-0410-b5e6-96231b3b80d8
* [modules] Fix crash with multiple levels of default template argument merging.Richard Smith2015-06-111-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239575 91177308-0d34-0410-b5e6-96231b3b80d8
* Work around MSVC miscompilation.Richard Smith2015-06-101-3/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239494 91177308-0d34-0410-b5e6-96231b3b80d8