This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] UppercaseLiteralSuffixCheck: bugfix: don't cripple substNonTypeTemplateParmExpr
AbandonedPublic

Authored by lebedev.ri on Oct 25 2018, 11:17 AM.

Details

Summary

The previous, clearly broken output:

/tmp/test.cpp:4:17: warning: integer literal has suffix 'lignment', which is not uppercase [hicpp-uppercase-literal-suffix]
  static_assert(alignment, "");
                ^~~~~~~~~
                 LIGNMENT

https://godbolt.org/z/iyWIrX

Is there some more general way this should be avoided?
Too bad i haven't thought of this/triggered this while developing :/

Diff Detail

Event Timeline

lebedev.ri created this revision.Oct 25 2018, 11:17 AM

What do you mean by "general way to avoid"? Templates?

What do you mean by "general way to avoid"? Templates?

I'm basically asking "is the unless(hasParent(substNonTypeTemplateParmExpr())) fix correct? or is there something else i'm missing?"

JonasToth accepted this revision.Oct 25 2018, 11:32 AM

I'm basically asking "is the unless(hasParent(substNonTypeTemplateParmExpr())) fix correct? or is there something else i'm missing?"

Ah ok, I am not aware of another way, but not an expert on the AST either :)
LGTM

This revision is now accepted and ready to land.Oct 25 2018, 11:32 AM
lebedev.ri abandoned this revision.Oct 25 2018, 12:49 PM

Reverted the check, reopened D52670.