[llvm-bugs] [Bug 52527] New: clang-format can introduce */ outside of comment, rejected by some compilers

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Nov 16 12:33:49 PST 2021


https://bugs.llvm.org/show_bug.cgi?id=52527

            Bug ID: 52527
           Summary: clang-format can introduce */ outside of comment,
                    rejected by some compilers
           Product: clang
           Version: 12.0
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Formatter
          Assignee: unassignedclangbugs at nondot.org
          Reporter: peterd at fb.com
                CC: djasper at google.com, klimek at google.com,
                    llvm-bugs at lists.llvm.org

When I use clang-format-diff.py on this:

void Foo(void (* /*fn*/)()) {}

I get this:

void Foo(void (*/*fn*/)()) {}

Which is rejected by MSVC at least under some configurations and versions.

Context:
https://app.circleci.com/pipelines/github/facebook/rocksdb/10051/workflows/cef8bc6a-faa4-45bd-9821-7fdc483985fb/jobs/241183

c:\users\circleci\project\db\db_block_cache_test.cc(395): warning C4138: '*/'
found outside of comment
c:\users\circleci\project\db\db_block_cache_test.cc(395): error C2220: warning
treated as error - no 'object' file generated

My work-around:
https://github.com/pdillinger/rocksdb/commit/c9885d2614d664f331cd998038e8e8f94a847d92

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20211116/7704f2a2/attachment.html>


More information about the llvm-bugs mailing list