1

when i use clang-tidy to add braces in short statement there is a bug. The code

else
    _pContext(blabla);

is replaced by

else
{_}
pContext(blabla);

do you know how to fixe it ? my .clang-tidy fil is like that

Checks:          'readability-braces-around-statements,readability-identifier-naming,modernize-use-override'
HeaderFilterRegex: ''
AnalyzeTemporaryDtors: true
CheckOptions:
  - key:             readability-braces-around-statements.ShortStatementLines
    value:           '0'
  - key:             readability-identifier-naming.ClassMemberPrefix
    value:           '_'
  - key:             readability-identifier-naming.PrivateMemberPrefix
    value:           '_'
  - key:             readability-identifier-naming.MemberSuffix
    value:           '_'
  - key:             readability-identifier-naming.ProtectedMemberPrefix
    value:           '_'
  - key:             readability-identifier-naming.PublicMemberPrefix
    value:           '_'
  - key:             readability-identifier-naming.ClassMemberCase
    value:           'camelBack'
  - key:             readability-identifier-naming.PublicMemberCase
    value:           'camelBack'
  - key:             readability-identifier-naming.ProtectedMemberCase
    value:           'camelBack'
  - key:             readability-identifier-naming.PrivateMemberCase
    value:           'camelBack'
  - key:             readability-identifier-naming.ClassConstantCase
    value:           'UPPER_CASE'
  - key:             readability-identifier-naming.ClassConstantPrefix
    value:           ''
  - key:             modernize-use-override
    value:           'OverrideSpelling'
Tom Penard
  • 141
  • 8

1 Answers1

1

Unless you are a standard library author, having an identifier name start with an underscore is illegal in C++. (More precisely: it's undefined behavior.)

So, I'd argue that this is not a bug. It's just turning one invalid code into another invalid code. :)

sebrockm
  • 5,733
  • 2
  • 16
  • 39