Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

google-readability-namespace-comments check does not handle C++17 nested namespaces #33673

Open Quuxplusone opened 7 years ago

Quuxplusone commented 7 years ago
Bugzilla Link PR34701
Status NEW
Importance P enhancement
Reported by Marek Kurdej (curdeius@gmail.com)
Reported on 2017-09-22 05:06:11 -0700
Last modified on 2017-09-27 01:22:55 -0700
Version unspecified
Hardware PC Windows NT
CC alexfh@google.com, curdeius@gmail.com, djasper@google.com, klimek@google.com
Fixed by commit(s)
Attachments .clang-tidy (195 bytes, text/plain)
Blocks
Blocked by
See also

Created attachment 19186 clang-tidy configuration file

This checks mishandles a correct trailing namespace comment and issues one warning for each namespace part.

For the correct code:

namespace a::b {} // namespace a::b

It issues warnings:

bug.cpp:1:18: warning: namespace 'a' ends with an unrecognized comment [google-readability-namespace-comments]
namespace a::b {} // namespace a::b
                 ^
c:\workspace\bugs\clang-tidy\google-readability-namespace-comments\bug.cpp:1:11: note: namespace 'a' starts here
namespace a::b {} // namespace a::b
          ^
note: this fix will not be applied because it overlaps with another fix
bug.cpp:1:18: warning: namespace 'b' ends with an unrecognized comment [google-readability-namespace-comments]
namespace a::b {} // namespace a::b
                 ^
c:\workspace\bugs\clang-tidy\google-readability-namespace-comments\bug.cpp:1:14: note: namespace 'b' starts here
namespace a::b {} // namespace a::b
             ^
note: this fix will not be applied because it overlaps with another fix
Suppressed 1 warnings (1 with check filters).
Quuxplusone commented 7 years ago

Attached .clang-tidy (195 bytes, text/plain): clang-tidy configuration file