[PATCH] D33722: [clang-tidy] Add checker for undelegated copy of base classes
Dominik Szabó via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Jun 16 05:32:43 PDT 2017
szdominik added inline comments.
================
Comment at: clang-tidy/misc/UndelegatedCopyOfBaseClassesCheck.cpp:92
+ // Loop until the beginning of the initialization list.
+ while (!Tok.is(tok::r_paren))
+ Lex.LexFromRawLexer(Tok);
----------------
aaron.ballman wrote:
> szdominik wrote:
> > aaron.ballman wrote:
> > > This doesn't balance tokens. What about:
> > > ```
> > > struct S {
> > > /* ... */
> > > };
> > >
> > > struct T : S {
> > > T(const T &O) : S((1 + 2), O) {}
> > > };
> > > ```
> > The loop search only the first right paren in the line, which is the end of parameter list ( "...&0**)**" ), so, as I see, it doesn't interesting what happens after the colon.
> Let me try again. :-)
> ```
> struct S {
> /* ... */
> };
>
> struct T : S {
> T(const T &O, int = (1 + 2)) : S((1 + 2), O) {}
> };
> ```
Ah, you're right. I'll figure out something... :)
https://reviews.llvm.org/D33722
More information about the cfe-commits
mailing list