------------------------------------------------------------------------
r213611 | rtrieu | 2014-07-21 21:06:54 -0700 (Mon, 21 Jul 2014) | 2 lines
More gracefully handle parentheses in templare arguments in template diffing.
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_35@214691
91177308-0d34-0410-b5e6-
96231b3b80d8
}
DeclRefExpr *DRE = dyn_cast<DeclRefExpr>(ArgExpr);
if (!DRE) {
- DRE = cast<DeclRefExpr>(cast<UnaryOperator>(ArgExpr)->getSubExpr());
+ DRE = cast<DeclRefExpr>(
+ cast<UnaryOperator>(ArgExpr->IgnoreParens())->getSubExpr());
}
return DRE->getDecl();
template <class T>
Wrapper<T> MakeWrapper();
-int global;
+int global, global2;
constexpr int * ptr = nullptr;
Wrapper<S<ptr>> W = MakeWrapper<S<&global>>();
// Don't print an extra '&' for 'ptr'
// CHECK-ELIDE-NOTREE: no viable conversion from 'Wrapper<S<&global>>' to 'Wrapper<S<ptr>>'
+
+Wrapper<S<(&global2)>> W2 = MakeWrapper<S<&global>>();
+// Handle parens correctly
+// CHECK-ELIDE-NOTREE: no viable conversion from 'Wrapper<S<&global>>' to 'Wrapper<S<global2>>'
}
// CHECK-ELIDE-NOTREE: {{[0-9]*}} errors generated.