[PATCH] D66487: Fix -Wimplicit-fallthrough warnings in regcomp.c
Aaron Ballman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 21 12:13:21 PDT 2019
aaron.ballman added inline comments.
================
Comment at: llvm/trunk/include/llvm/Support/Compiler.h:19
+#ifdef __cplusplus
#include <new>
----------------
nickdesaulniers wrote:
> The original code used `#if __cplusplus` (notice `#if`, not `#ifdef`). I'm surprised that worked. Maybe this change needs to as well?
That's not the issue causing the compile errors.
================
Comment at: llvm/trunk/include/llvm/Support/Compiler.h:152
// reused.
#if __has_cpp_attribute(clang::reinitializes)
#define LLVM_ATTRIBUTE_REINITIALIZES [[clang::reinitializes]]
----------------
The problem is that `__has_cpp_attribute` doesn't exist in C mode, so the fallback definition from line 41 is used rather than the preprocessor implementation, and `::` is a syntactically invalid token in C.
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D66487/new/
https://reviews.llvm.org/D66487
More information about the llvm-commits
mailing list