summaryrefslogtreecommitdiffstats
path: root/clang/unittests/AST/DeclMatcher.h
Commit message (Collapse)AuthorAgeFilesLines
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* Fix duplicate class template definitions problemGabor Marton2018-05-231-4/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: We fail to import a `ClassTemplateDecl` if the "To" context already contains a definition and then a forward decl. This is because `localUncachedLookup` does not find the definition. This is not a lookup error, the parser behaves differently than assumed in the importer code. A `DeclContext` contains one DenseMap (`LookupPtr`) which maps names to lists. The list is a special list `StoredDeclsList` which is optimized to have one element. During building the initial AST, the parser first adds the definition to the `DeclContext`. Then during parsing the second declaration (the forward decl) the parser again calls `DeclContext::addDecl` but that will not add a new element to the `StoredDeclsList` rarther it simply overwrites the old element with the most recent one. This patch fixes the error by finding the definition in the redecl chain. Added tests for the same issue with `CXXRecordDecl` and with `ClassTemplateSpecializationDecl`. These tests pass and they pass because in `VisitRecordDecl` and in `VisitClassTemplateSpecializationDecl` we already use `D->getDefinition()` after the lookup. Reviewers: a.sidorin, xazax.hun, szepet Subscribers: rnkovacs, dkrupp, cfe-commits Differential Revision: https://reviews.llvm.org/D46950 llvm-svn: 333082
* [ASTImporter] Add test helper FixturePeter Szecsi2018-03-301-0/+68
Add a helper test Fixture, so we can add tests which can check internal attributes of AST nodes like getPreviousDecl(), isVirtual(), etc. This enables us to check if a redeclaration chain is correctly built during import, if the virtual flag is preserved during import, etc. We cannot check such attributes with the existing testImport. Also, this fixture makes it possible to import from several "From" contexts. We also added several test cases here, some of them are disabled. We plan to pass the disabled tests in other patches. Patch by Gabor Marton! Differential Revision: https://reviews.llvm.org/D43967 llvm-svn: 328906
OpenPOWER on IntegriCloud