File tree Expand file tree Collapse file tree 2 files changed +17
-10
lines changed
Expand file tree Collapse file tree 2 files changed +17
-10
lines changed Original file line number Diff line number Diff line change @@ -159,3 +159,8 @@ usethis::edit_file("src/absl/container/internal/raw_hash_set.h")
159159# CRAN compiles with -Wpedantic, so we can't use the __int128 intrinsic type
160160# undefine ABSL_HAVE_INTRINSIC_INT128 here:
161161usethis :: edit_file(" src/absl/base/config.h" )
162+
163+ # The use of ABSL_HAVE_CPP_ATTRIBUTE() with ABSL_FALLTHROUGH_INTENDED
164+ # here uses C++17 attributes even if -std=c++17 is not set,
165+ # which causes CRAN warnings with -Wpedantic
166+ usethis :: edit_file(" src/absl/base/attributes.h" )
Original file line number Diff line number Diff line change 629629// no effect on diagnostics. In any case this macro has no effect on runtime
630630// behavior and performance of code.
631631
632- #ifdef ABSL_FALLTHROUGH_INTENDED
633- #error "ABSL_FALLTHROUGH_INTENDED should not be defined."
634- #elif ABSL_HAVE_CPP_ATTRIBUTE(fallthrough)
635- #define ABSL_FALLTHROUGH_INTENDED [[fallthrough]]
636- #elif ABSL_HAVE_CPP_ATTRIBUTE(clang::fallthrough)
637- #define ABSL_FALLTHROUGH_INTENDED [[clang::fallthrough]]
638- #elif ABSL_HAVE_CPP_ATTRIBUTE(gnu::fallthrough)
639- #define ABSL_FALLTHROUGH_INTENDED [[gnu::fallthrough]]
640- #else
632+ // The use of ABSL_HAVE_CPP_ATTRIBUTE() here uses C++17 attributes
633+ // even if -std=c++17 is not set, which does not work with -Wpedantic on R
634+ // #ifdef ABSL_FALLTHROUGH_INTENDED
635+ // #error "ABSL_FALLTHROUGH_INTENDED should not be defined."
636+ // #elif ABSL_HAVE_CPP_ATTRIBUTE(fallthrough)
637+ // #define ABSL_FALLTHROUGH_INTENDED [[fallthrough]]
638+ // #elif ABSL_HAVE_CPP_ATTRIBUTE(clang::fallthrough)
639+ // #define ABSL_FALLTHROUGH_INTENDED [[clang::fallthrough]]
640+ // #elif ABSL_HAVE_CPP_ATTRIBUTE(gnu::fallthrough)
641+ // #define ABSL_FALLTHROUGH_INTENDED [[gnu::fallthrough]]
642+ // #else
641643#define ABSL_FALLTHROUGH_INTENDED \
642644 do { \
643645 } while (0 )
644- #endif
646+ // #endif
645647
646648// ABSL_DEPRECATED()
647649//
You can’t perform that action at this time.
0 commit comments