mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-05 03:21:42 +00:00
Update for C++17 and fix MSVC warnings (#1694)
* Update MSVC arguments * Fix json allocator * Fix simulation diamond * Bump gtest * Remove empty varargs in unit tests * Replace test case with test suite * Remove deprecation warning in optional * Remove need for NOMIXMAX to be defined in wpilib headers
This commit is contained in:
committed by
Peter Johnson
parent
fb1239a2ad
commit
221011494d
@@ -117,6 +117,11 @@
|
||||
#ifndef LLVM_NODISCARD
|
||||
#if __cplusplus > 201402L && __has_cpp_attribute(nodiscard)
|
||||
#define LLVM_NODISCARD [[nodiscard]]
|
||||
// Detect MSVC directly, since __cplusplus still defaults to old version
|
||||
#elif _MSVC_LANG >= 201703L
|
||||
#define LLVM_NODISCARD [[nodiscard]]
|
||||
#elif _MSC_VER
|
||||
#define LLVM_NODISCARD
|
||||
#elif !__cplusplus
|
||||
// Workaround for llvm.org/PR23435, since clang 3.6 and below emit a spurious
|
||||
// error when __has_cpp_attribute is given a scoped attribute in C mode.
|
||||
@@ -236,6 +241,11 @@
|
||||
#ifndef LLVM_FALLTHROUGH
|
||||
#if __cplusplus > 201402L && __has_cpp_attribute(fallthrough)
|
||||
#define LLVM_FALLTHROUGH [[fallthrough]]
|
||||
// Detect MSVC directly, since __cplusplus still defaults to old version
|
||||
#elif _MSVC_LANG >= 201703L
|
||||
#define LLVM_FALLTHROUGH [[fallthrough]]
|
||||
#elif _MSC_VER
|
||||
#define LLVM_FALLTHROUGH
|
||||
#elif __has_cpp_attribute(gnu::fallthrough)
|
||||
#define LLVM_FALLTHROUGH [[gnu::fallthrough]]
|
||||
#elif !__cplusplus
|
||||
|
||||
Reference in New Issue
Block a user