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: unassignedclangb...@nondot.org
          Reporter: ideasma...@gmail.com
                CC: djas...@google.com, kli...@google.com,
                    llvm-bugs@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to