summaryrefslogtreecommitdiffstats
path: root/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [gtest] The way EXPECT_TEST now works after upgrading gtest triggers anChandler Carruth2017-01-041-3/+6
| | | | | | | | ODR use. These traits don't have a definition as they're intended to be used strictly at compile time. Change the tests to use static_assert to move the entire thing into compile-time. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@291036 91177308-0d34-0410-b5e6-96231b3b80d8
* DR1315: a non-type template argument in a partial specialization is permittedRichard Smith2016-12-281-2/+2
| | | | | | | | | | | to make reference to template parameters. This is only a partial implementation; we retain the restriction that the argument must not be type-dependent, since it's unclear how that would work given the existence of other language rules requiring an exact type match in this context, even for type-dependent cases (a question has been raised on the core reflector). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@290647 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTMatcher] Add hasReplacementType matcher for SubstTemplateTypeParmTypeMalcolm Parsons2016-12-081-0/+17
| | | | | | | | | | | | Summary: Needed for https://reviews.llvm.org/D27166 Reviewers: sbenza, bkramer, klimek Subscribers: aemerson, cfe-commits Differential Revision: https://reviews.llvm.org/D27447 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289042 91177308-0d34-0410-b5e6-96231b3b80d8
* Adds hasUnqualifiedDesugaredType to allow matching through type sugar.Manuel Klimek2016-12-011-0/+9
| | | | | | Differential Revision: https://reviews.llvm.org/D27207 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288366 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTMatcher] Add CXXNewExpr support to hasDeclarationMalcolm Parsons2016-10-311-0/+6
| | | | | | | | | | Reviewers: sbenza, lukasza, aaron.ballman, klimek Subscribers: lukasza, sbenza, cfe-commits Differential Revision: https://reviews.llvm.org/D26032 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@285644 91177308-0d34-0410-b5e6-96231b3b80d8
* Traversing template paramter lists of DeclaratorDecls and/or TagDecls.Nico Weber2016-09-131-0/+83
| | | | | | | | | | | | | | | The unit tests in this patch demonstrate the need to traverse template parameter lists of DeclaratorDecls (e.g. VarDecls, CXXMethodDecls) and TagDecls (e.g. EnumDecls, RecordDecls). Fixes PR29042. https://reviews.llvm.org/D24268 Patch from Lukasz Łukasz Anforowicz <lukasza@chromium.org>! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@281345 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTMatchers] Add matchers canReferToDecl() and hasUnderlyingDecl()Martin Bohme2016-08-091-0/+34
| | | | | | | | | | | | Summary: Required for D22220 Reviewers: sbenza, klimek, aaron.ballman, alexfh Subscribers: alexfh, klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D23004 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@278123 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTMatcher] Add templateName matcher.Haojian Wu2016-07-291-0/+8
| | | | | | | | | | Reviewers: klimek Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D22963 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@277155 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTMatcher] Add hasTemplateArgument/hasAnyTemplateArgument support in ↵Haojian Wu2016-07-291-0/+13
| | | | | | | | | | | | functionDecl. Reviewers: klimek Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D22957 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@277142 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTMatchers] New forEachOverriden matcher.Clement Courbet2016-07-051-0/+44
| | | | | | Matches methods overridden by the given method. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274531 91177308-0d34-0410-b5e6-96231b3b80d8
* IgnoringImplicit matcher.Cong Liu2016-06-241-0/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@273659 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "[ASTMatchers] New forEachOverriden matcher."Chandler Carruth2016-06-111-44/+0
| | | | | | | This reverts commit r272386. It doesn't compile with MSVC and those bots have been red the entire day as a consequence. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@272453 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTMatchers] New forEachOverriden matcher.Clement Courbet2016-06-101-0/+44
| | | | | | Matches methods overridden by the given method. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@272386 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTMatchers] Breaking change of `has` matcherPiotr Padlewski2016-05-311-2/+2
| | | | | | | | has matcher can now match to implicit and paren casts http://reviews.llvm.org/D20801 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@271288 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTMatchers] Add support of hasCondition for SwitchStmt.Etienne Bergeron2016-05-301-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The switch statement could be added to the hasCondition matcher. Example: ``` clang-query> match switchStmt(hasCondition(ignoringImpCasts(declRefExpr()))) ``` Output: ``` Match #1: Binding for "root": SwitchStmt 0x2f9b528 </usr/local/google/home/etienneb/examples/enum.cc:35:3, line:38:3> |-<<<NULL>>> |-ImplicitCastExpr 0x2f9b510 <line:35:11> 'int' <IntegralCast> | `-ImplicitCastExpr 0x2f9b4f8 <col:11> 'enum Color' <LValueToRValue> | `-DeclRefExpr 0x2f9b4d0 <col:11> 'enum Color' lvalue Var 0x2f9a118 'C' 'enum Color' `-CompoundStmt 0x2f9b610 <col:14, line:38:3> |-CaseStmt 0x2f9b578 <line:36:3, col:22> | |-ImplicitCastExpr 0x2f9b638 <col:8> 'int' <IntegralCast> | | `-DeclRefExpr 0x2f9b550 <col:8> 'enum Size' EnumConstant 0x2f99e40 'Small' 'enum Size' | |-<<<NULL>>> | `-ReturnStmt 0x2f9b5d0 <col:15, col:22> | `-IntegerLiteral 0x2f9b5b0 <col:22> 'int' 1 `-DefaultStmt 0x2f9b5f0 <line:37:3, col:12> `-BreakStmt 0x2f9b5e8 <col:12> 1 match. ``` Reviewers: aaron.ballman, sbenza, klimek Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D20767 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@271208 91177308-0d34-0410-b5e6-96231b3b80d8
* Dividied ASTMatcherTests into 4 filesPiotr Padlewski2016-05-171-0/+1979
fix for long compilation [20061] http://reviews.llvm.org/D20210 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269802 91177308-0d34-0410-b5e6-96231b3b80d8