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 -2
View File
@@ -152,5 +152,4 @@ SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Latest
TabWidth: 4
UseTab: Never
...
UseTab: Never
+6 -3
View File
@@ -1,10 +1,14 @@
---
Checks: '*,-modernize-use-nodiscard'
Checks: '*,-modernize-use-nodiscard,-llvmlibc-*,-fuchsia-trailing-return,-fuchsia*,-altera-*'
WarningsAsErrors: ''
HeaderFilterRegex: ''
AnalyzeTemporaryDtors: false
FormatStyle: file
CheckOptions:
- key: readability-braces-around-statements.ShortStatementLines
value: '1'
- key: hicpp-braces-around-statements.ShortStatementLines
value: '1'
- key: bugprone-use-after-move
value: '1'
- key: bugprone-assert-side-effect.AssertMacros
@@ -40,5 +44,4 @@ CheckOptions:
- key: hicpp-special-member-functions.AllowMissingMoveFunctions
value: '0'
- 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(Catch)
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++)
if(APPLE)
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
Calculator.cpp
+1
View File
@@ -1,5 +1,6 @@
#include "Calculator.hpp"
#include <cstdint>
#include <ranges>
#include <unordered_map>
+4 -5
View File
@@ -1,10 +1,9 @@
#ifndef CALCULATOR_CHALLENGE_WORKSPACE_HPP
#define CALCULATOR_CHALLENGE_WORKSPACE_HPP
#ifndef CALCULATOR_CHALLENGE_CALCULATOR_HPP
#define CALCULATOR_CHALLENGE_CALCULATOR_HPP
#include <cstdint>
#include <stack>
#include <optional>
#include <string>
#include <unordered_map>
#include <utility>
#include <vector>
#include "Operand.hpp"
+1 -1
View File
@@ -27,7 +27,7 @@ struct OperationMembers
};
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{};