• Stephan Bergmann's avatar
    Make loplugin:casttovoid more resilient against macros · 11b741ac
    Stephan Bergmann yazdı
    ...in the type at the start of a ParmVarDecl, so that it does not erroneously
    assume in isSharedCAndCppCode that the whole decl is in "the body of a macro
    definition".  (Even better might be to check the whole ParmVarDecl is inside one
    macro body.)
    
    Turns out that vcl/unx/gtk/gtkdata.cxx indirectly includes stdbool.h via some
    vcl/inc/unx/saldisp.hxx -> workdir/UnpackedTarball/epoxy/include/epoxy/glx.h ->
    workdir/UnpackedTarball/epoxy/include/epoxy/gl.h, and Clang's stdbool.h contains
    
    > /* Don't define bool, true, and false in C++, except as a GNU extension. */
    > #ifndef __cplusplus
    > #define bool _Bool
    > #define true 1
    > #define false 0
    > #elif defined(__GNUC__) && !defined(__STRICT_ANSI__)
    > /* Define _Bool, bool, false, true as a GNU extension. */
    > #define _Bool bool
    > #define bool  bool
    > #define false false
    > #define true  true
    > #endif
    
    since <http://llvm.org/viewvc/llvm-project?view=revision&revision=115028>
    "Define _Bool, bool, true, and false macros in <stdbool.h> when we're in a
    GNU-compatible C++ dialect. Fixes <rdar://problem/8477819>" while GCC's
    stdbool.h has meanwhile been improved with
    <https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=216679> "C++11
    explicitly forbids macros for bool, true and false" to
    
    > #ifndef __cplusplus
    >
    > #define bool	_Bool
    > #define true	1
    > #define false	0
    >
    > #else /* __cplusplus */
    >
    > /* Supporting _Bool in C++ is a GCC extension.  */
    > #define _Bool	bool
    >
    > #if __cplusplus < 201103L
    > /* Defining these macros in C++98 is a GCC extension.  */
    > #define bool	bool
    > #define false	false
    > #define true	true
    > #endif
    >
    > #endif /* __cplusplus */
    
    Change-Id: I42caab83ac6e4d5e5297376136a6bbe6f3d70818
    11b741ac