Make build -Wundef clean

Use `#ifdef __cpp_noexcept_function_type` instead of
`#if __cpp_noexcept_function_type` to avoid `-Wundef` warnings.
Also add that flag to the test flags to detect those on CI.
This commit is contained in:
Alexander Grund committed 2022-07-07 10:05:05 +02:00
1 parent d2a4a6bf0a
commit d71524a799
5 files changed
+58 -57

No files matched your search

+1
View File
@@ -25,6 +25,7 @@ project : requirements
<toolset>gcc:<cxxflags>-Wno-uninitialized
<toolset>gcc:<cxxflags>-Wno-int-in-bool-context
<toolset>gcc:<cxxflags>-Wno-bool-operation
<toolset>gcc:<cxxflags>-Wundef
<toolset>gcc:<warnings-as-errors>on
<toolset>intel:<warnings-as-errors>on
<toolset>sun:<warnings-as-errors>on
+1 -1
View File
@@ -43,7 +43,7 @@ typedef void foo1_t(int);
typedef void foo2_t(int&, double);
typedef void foo3_t(int&, bool, int, int);
typedef void foo4_t(int, bool, int*, int[], int, int, int, int, int);
#if __cpp_noexcept_function_type
#ifdef __cpp_noexcept_function_type
typedef int foo5_t(void)noexcept;
typedef int foo6_t(double)noexcept(false);
typedef int foo7_t(int, double)noexcept(true);
+2 -2
View File
@@ -193,7 +193,7 @@ struct UDT
int f2();
int f3(int);
int f4(int, float);
#if __cpp_noexcept_function_type
#ifdef __cpp_noexcept_function_type
void f5()noexcept;
int f6(int)noexcept(true);
double f7()noexcept(false);
@@ -209,7 +209,7 @@ typedef int (UDT::*mf3)(int);
typedef int (UDT::*mf4)(int, float);
typedef int (UDT::*mp);
typedef int (UDT::*cmf)(int) const;
#if __cpp_noexcept_function_type
#ifdef __cpp_noexcept_function_type
typedef void (UDT::*mf5)()noexcept;
typedef int (UDT::*mf6)(int)noexcept;
typedef double (UDT::*mf7)()noexcept;