[llvm-bugs] [Bug 31908] New: formatter doesn't understand preprocessor directives such as __has_include and incorrectly reformats them

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Feb 8 18:40:47 PST 2017


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

            Bug ID: 31908
           Summary: formatter doesn't understand preprocessor directives
                    such as __has_include and incorrectly reformats them
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Formatter
          Assignee: unassignedclangbugs at nondot.org
          Reporter: dcheng at google.com
                CC: djasper at google.com, klimek at google.com,
                    llvm-bugs at lists.llvm.org
    Classification: Unclassified

https://chromium-review.googlesource.com/c/439744/1/util/stdlib/cxx.h#37 for an
example.

#if !defined(_LIBCPP_VERSION)
#if defined(__has_include)
#if __has_include(<bits/c++config.h>)
#include <bits/c++config.h>
#endif
#else
#include <bits/c++config.h>
#endif
#endif

gets turned into

#if !defined(_LIBCPP_VERSION)
#if defined(__has_include)
#if __has_include(<bits / c++ config.h>)
#include <bits/c++config.h>
#endif
#else
#include <bits/c++config.h>
#endif
#endif

-- 
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/20170209/efb3b13a/attachment.html>


More information about the llvm-bugs mailing list