[PATCH] D62329: [ASTImporter] Structural eq: handle DependentScopeDeclRefExpr

Gabor Marton via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 3 07:39:21 PDT 2019


martong marked 2 inline comments as done.
martong added inline comments.


================
Comment at: cfe/trunk/lib/AST/ASTStructuralEquivalence.cpp:173
+                                    DE2->getQualifier());
+  } else if (auto CastE1 = dyn_cast<ImplicitCastExpr>(E1)) {
+    auto *CastE2 = dyn_cast<ImplicitCastExpr>(E2);
----------------
a_sidorin wrote:
> Hi Gabor,
> Is there any test for this branch?
Yes, there are implicit tests.
I had to add this branch because after rebasing to master a new AST node is created during the parsing of the test code.
This test code
```
template <typename T, typename enable_if<S1<T>::value>::type>
```
had this AST before the rebase:
```
TemplateSpecializationType 0xbd2b80 'enable_if<S1<T>::value>' dependent enable_if
`-TemplateArgument expr
  `-DependentScopeDeclRefExpr 0xbd2b28 '<dependent type>' lvalue
```
and this after rebase:
```
TemplateSpecializationType 0xc0f0c0 'enable_if<S1<T>::value>' dependent enable_if
`-TemplateArgument expr
  `-ImplicitCastExpr 0xc0f090 '_Bool' <Dependent>
    `-DependentScopeDeclRefExpr 0xc0f058 '<dependent type>' lvalue
```

So, `SameStructsInDependentScopeDeclRefExpr`, `DifferentStructsInDependentScopeDeclRefExpr` and `DifferentValueInDependentScopeDeclRefExpr` do implicitly test this branch. These tests would not work without the branch for `ImplicitCastExpr`.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D62329/new/

https://reviews.llvm.org/D62329





More information about the cfe-commits mailing list