[llvm-bugs] [Bug 37336] New: -rewrite-macros breaks for consecutive comments

via llvm-bugs llvm-bugs at lists.llvm.org
Fri May 4 01:30:21 PDT 2018


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

            Bug ID: 37336
           Summary: -rewrite-macros breaks for consecutive comments
           Product: clang
           Version: 6.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: jackanth3 at gmail.com
                CC: llvm-bugs at lists.llvm.org

The following code:

/* Comment 1 */
/* Comment 2 */

Gets rewritten by -rewrite-macros as:

/* Comment 1 */
 /*/* Comment 2 */*/

which then will fail to compile. This behaviour applies to the first pair of
any consecutive comments separated only by whitespace, including in the context
of other code. E.g.

// Comment 3

/* Comment 4 */

becomes:

// Comment 3

 /*/* Comment 4 */*/

and

// Comment 5
// Comment 6
// Comment 7
// Comment 8

becomes

// Comment 5
 /* // Comment 6 */
// Comment 7
// Comment 8

(The last one is legal code but still not desirable.)

-- 
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/20180504/52f17dc6/attachment.html>


More information about the llvm-bugs mailing list