[PATCH] D92600: [ASTImporter] Add support for importing GenericSelectionExpr AST nodes.
Gabor Marton via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Dec 15 03:14:10 PST 2020
martong requested changes to this revision.
martong added inline comments.
This revision now requires changes to proceed.
================
Comment at: clang/unittests/AST/StructuralEquivalenceTest.cpp:1656-1662
+ R"(
+ template <typename T>
+ void f() {
+ T x;
+ (void)_Generic(x, float: 1, int: 0);
+ }
+ )",
----------------
> Change the DeclMatcher.h test code to expose the ability to not assert on null Nodes from a match.
The original idea was to assert in the DeclMatcher to indicate a failure in the test itself. In the past it happened to me often that I wrote a wrong matcher and that assertion indicated it and that was really helpful.
So, I'd suggest an alternative approach instead of this change in the DeclMatcher: Try to instantiate the template function itself, so even if the delayed template instantiation option is set, the compiler must instantiate.
Related code in other ASTImporter tests:
https://github.com/llvm/llvm-project/blob/bd0709266911bce2f1e8a875f9ed49d56953f323/clang/unittests/AST/ASTImporterGenericRedeclTest.cpp#L60
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D92600/new/
https://reviews.llvm.org/D92600
More information about the cfe-commits
mailing list