https://bugs.llvm.org/show_bug.cgi?id=44237
Bug ID: 44237
Summary: cleanupAroundReplacements should insert #include
directives after #pragma once
Product: clang
Version: 8.0
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: Formatter
Assignee: unassignedclangb...@nondot.org
Reporter: igor.bronst...@gmail.com
CC: djas...@google.com, kli...@google.com,
llvm-bugs@lists.llvm.org
Our tool uses clang::format::cleanupAroundReplacements() to insert #include
directives to generated replacements. I can see the following inconsistent
logic: if we try insert #include directives to a header file with a header
guard (#ifndef #define), the directive will be correctly inserted after the
guard. However this logic doesn't apply to #pragma once. The #include
directives will be inserted before the #pragma. This looks wrong for us.
#pragma once should be treated as a header guard in this usecase.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs