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

            Bug ID: 43861
           Summary: leading c-style comments mangle preprocessor macro
                    formatting (output does not compile)
           Product: clang
           Version: 9.0
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Formatter
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected]

Created attachment 22754
  --> https://bugs.llvm.org/attachment.cgi?id=22754&action=edit
unformatted source

The reformatted output fails to compile if a C-style comment exists prior to
the '#' on a line that defines a preprocessor macro.

https://godbolt.org/z/Bg2D_P demonstrates this if you right-click the source
window and choose "Format text".


/* A leading comment */ #define FOO (3)

int main()
{
    return FOO;    
}


becomes


/* A leading comment */ #define FOO(3)

    int main() {
  return FOO;
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to