fix: build under gcc

This commit is contained in:
2024-03-15 00:53:14 +00:00
parent 5634d1bb39
commit 1e39cc3431
7 changed files with 18 additions and 13 deletions
-1
View File
@@ -153,4 +153,3 @@ SpacesInSquareBrackets: false
Standard: Latest Standard: Latest
TabWidth: 4 TabWidth: 4
UseTab: Never UseTab: Never
...
+5 -2
View File
@@ -1,10 +1,14 @@
--- ---
Checks: '*,-modernize-use-nodiscard' Checks: '*,-modernize-use-nodiscard,-llvmlibc-*,-fuchsia-trailing-return,-fuchsia*,-altera-*'
WarningsAsErrors: '' WarningsAsErrors: ''
HeaderFilterRegex: '' HeaderFilterRegex: ''
AnalyzeTemporaryDtors: false AnalyzeTemporaryDtors: false
FormatStyle: file FormatStyle: file
CheckOptions: CheckOptions:
- key: readability-braces-around-statements.ShortStatementLines
value: '1'
- key: hicpp-braces-around-statements.ShortStatementLines
value: '1'
- key: bugprone-use-after-move - key: bugprone-use-after-move
value: '1' value: '1'
- key: bugprone-assert-side-effect.AssertMacros - key: bugprone-assert-side-effect.AssertMacros
@@ -41,4 +45,3 @@ CheckOptions:
value: '0' value: '0'
- key: hicpp-special-member-functions.AllowSoleDefaultDtor - key: hicpp-special-member-functions.AllowSoleDefaultDtor
value: '0' value: '0'
...
+1
View File
@@ -9,4 +9,5 @@
} }
} }
], ],
"editor.formatOnSave": true,
} }
+4 -2
View File
@@ -27,8 +27,10 @@ list(APPEND CMAKE_MODULE_PATH ${catch2_SOURCE_DIR}/extras)
include(CTest) include(CTest)
include(Catch) include(Catch)
set(CMAKE_C_COMPILER /opt/homebrew/Cellar/llvm@16/16.0.6/bin/clang) if(APPLE)
set(CMAKE_CXX_COMPILER /opt/homebrew/Cellar/llvm@16/16.0.6/bin/clang++) set(CMAKE_C_COMPILER /opt/homebrew/Cellar/llvm@16/16.0.6/bin/clang)
set(CMAKE_CXX_COMPILER /opt/homebrew/Cellar/llvm@16/16.0.6/bin/clang++)
endif()
SET(CALCULATOR_CHALLENGE_SOURCES SET(CALCULATOR_CHALLENGE_SOURCES
Calculator.cpp Calculator.cpp
+1
View File
@@ -1,5 +1,6 @@
#include "Calculator.hpp" #include "Calculator.hpp"
#include <cstdint>
#include <ranges> #include <ranges>
#include <unordered_map> #include <unordered_map>
+4 -5
View File
@@ -1,10 +1,9 @@
#ifndef CALCULATOR_CHALLENGE_WORKSPACE_HPP #ifndef CALCULATOR_CHALLENGE_CALCULATOR_HPP
#define CALCULATOR_CHALLENGE_WORKSPACE_HPP #define CALCULATOR_CHALLENGE_CALCULATOR_HPP
#include <cstdint> #include <optional>
#include <stack>
#include <string> #include <string>
#include <unordered_map> #include <utility>
#include <vector> #include <vector>
#include "Operand.hpp" #include "Operand.hpp"
+1 -1
View File
@@ -27,7 +27,7 @@ struct OperationMembers
}; };
template<typename T> template<typename T>
auto text_to_number(std::string_view text) noexcept auto text_to_number(std::string_view text) noexcept -> T
{ {
if (text.empty()) return T{}; if (text.empty()) return T{};