[PATCH] D26750: [clang-tidy] Add modernize-use-default-member-init check

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 19 12:15:32 PST 2016


aaron.ballman added inline comments.


================
Comment at: clang-tidy/modernize/UseDefaultMemberInitCheck.cpp:77-78
+static bool sameValue(const Expr *E1, const Expr *E2) {
+  E1 = ignoreUnaryPlus(getInitializer(E1->IgnoreImpCasts()));
+  E2 = ignoreUnaryPlus(getInitializer(E2->IgnoreImpCasts()));
+
----------------
malcolm.parsons wrote:
> aaron.ballman wrote:
> > malcolm.parsons wrote:
> > > aaron.ballman wrote:
> > > > Do you also want to ignore paren expressions?
> > > Maybe. 
> > > Am I reimplementing some existing clang function here?
> > You can use `IgnoreParenImpCasts()` instead.
> I mean is sameValue() implemented elsewhere?
Not in a general form in Clang, at least that I am aware of.


https://reviews.llvm.org/D26750





More information about the cfe-commits mailing list