[llvm-bugs] [Bug 37200] clang-format mangles a macro function named "and"

via llvm-bugs llvm-bugs at lists.llvm.org
Fri May 31 08:08:28 PDT 2019


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

Nico Weber <nicolasweber at gmx.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |WONTFIX
             Status|NEW                         |RESOLVED
                 CC|                            |nicolasweber at gmx.de

--- Comment #1 from Nico Weber <nicolasweber at gmx.de> ---
`and` is a keyword in C++, and using it as a macro name isn't supported.

$ out/gn/bin/clang -c test3.cc
test3.cc:1:9: error: C++ operator 'and' (aka '&&') used as a macro name
#define and(x, y) 4
        ^

$ out/gn/bin/clang-cl -c test3.cc -Wall
test3.cc(1,9): warning: C++ operator 'and' (aka '&&') used as a macro name
[-Wmicrosoft-cpp-macro]
#define and(x, y) 4
        ^

-- 
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/20190531/b8c113ad/attachment.html>


More information about the llvm-bugs mailing list