[llvm-bugs] [Bug 40288] New: Defining __func__ causes IndentPPDirectives header guard detection to fail

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Jan 10 13:42:56 PST 2019


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

            Bug ID: 40288
           Summary: Defining __func__ causes IndentPPDirectives header
                    guard detection to fail
           Product: clang
           Version: 7.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Formatter
          Assignee: unassignedclangbugs at nondot.org
          Reporter: ideasman42 at gmail.com
                CC: djasper at google.com, klimek at google.com,
                    llvm-bugs at lists.llvm.org

Given this C header.


    #ifndef __TEST_H__
    #define __TEST_H__
    #define __func__ __FUNCTION__
    #endif


And this configuration:


    IndentPPDirectives: AfterHash


Header guard detection fails, resulting in:


    #ifndef __TEST_H__
    #  define __TEST_H__
    #  define __func__ __FUNCTION__
    #endif

If `__func__` is renamed to anything else, eg: `__sunk__`, indentation is
correctly set resulting in 

    #ifndef __TEST_H__
    #define __TEST_H__
    #define __sunk__ __FUNCTION__
    #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/20190110/e4f11ad0/attachment.html>


More information about the llvm-bugs mailing list