Skip to content

Commit 55f1490

Browse files
authored
Merge pull request #2862 from verilog-to-routing/increase_cpp_ver_20
Increase C++ version from 17 to 20
2 parents bb0005c + f7c8c2d commit 55f1490

23 files changed

+53
-49
lines changed

.github/workflows/test.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,6 @@ jobs:
439439
- { name: 'GCC 11 (Ubuntu Noble - 24.04)', eval: 'CC=gcc-11 && CXX=g++-11', }
440440
- { name: 'GCC 12 (Ubuntu Noble - 24.04)', eval: 'CC=gcc-12 && CXX=g++-12', }
441441
- { name: 'GCC 14 (Ubuntu Noble - 24.04)', eval: 'CC=gcc-14 && CXX=g++-14', }
442-
- { name: 'Clang 15 (Ubuntu Noble - 24.04)', eval: 'CC=clang-15 && CXX=clang++-15', }
443442
- { name: 'Clang 16 (Ubuntu Noble - 24.04)', eval: 'CC=clang-16 && CXX=clang++-16', }
444443
- { name: 'Clang 17 (Ubuntu Noble - 24.04)', eval: 'CC=clang-17 && CXX=clang++-17', }
445444
- { name: 'Clang 18 (Ubuntu Noble - 24.04)', eval: 'CC=clang-18 && CXX=clang++-18', }

CMakeLists.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@ add_definitions("-DVTR_ASSERT_LEVEL=${VTR_ASSERT_LEVEL}")
9393
include(CheckCXXCompilerFlag)
9494

9595
#
96-
# We require c++17 support
96+
# We require c++20 support
9797
#
98-
set(CMAKE_CXX_STANDARD 17)
98+
set(CMAKE_CXX_STANDARD 20)
9999
set(CMAKE_CXX_STANDARD_REQUIRED ON)
100100
set(CMAKE_CXX_EXTENSIONS OFF) #No compiler specific extensions
101101

@@ -160,7 +160,7 @@ else()
160160
"-Wcast-align" #Warn if a cast causes memory alignment changes
161161
"-Wshadow" #Warn if local variable shadows another variable
162162
"-Wformat=2" #Sanity checks for printf-like formatting
163-
"-Wno-format-nonliteral" # But don't worry about non-literal formtting (i.e. run-time printf format strings)
163+
"-Wno-format-nonliteral" # But don't worry about non-literal formatting (i.e. run-time printf format strings)
164164
"-Wlogical-op" #Checks for logical op when bit-wise expected
165165
"-Wmissing-declarations" #Warn if a global function is defined with no declaration
166166
"-Wmissing-include-dirs" #Warn if a user include directory is missing
@@ -178,10 +178,10 @@ else()
178178
"-Wduplicated-cond" #Warn about identical conditions in if-else chains
179179
"-Wduplicated-branches" #Warn when different branches of an if-else chain are equivalent
180180
"-Wnull-dereference" #Warn about null pointer dereference execution paths
181-
"-Wuninitialized" #Warn about unitialized values
181+
"-Wuninitialized" #Warn about uninitialized values
182182
"-Winit-self" #Warn about self-initialization
183183
"-Wcatch-value=3" #Warn when catch statements don't catch by reference
184-
"-Wextra-semi" #Warn about redudnant semicolons
184+
"-Wextra-semi" #Warn about redundant semicolons
185185
"-Wimplicit-fallthrough=3" #Warn about case fallthroughs, but allow 'fallthrough' comments to suppress warnings
186186
#GCC-like optional
187187
#"-Wsuggest-final-types" #Suggest where 'final' would help if specified on a type methods

libs/EXTERNAL/libezgl/include/ezgl/point.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class point2d {
3636
/**
3737
* Create a point at the given x and y position.
3838
*/
39-
point2d(double x_coord, double y_coord) : x(x_coord), y(y_coord)
39+
point2d(double x_coord, double y_coord) noexcept : x(x_coord), y(y_coord)
4040
{
4141
}
4242

libs/EXTERNAL/libezgl/include/ezgl/rectangle.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class rectangle {
3333
/**
3434
* Default constructor: Create a zero-sized rectangle at {0,0}.
3535
*/
36-
rectangle() : m_first({0, 0}), m_second({0, 0})
36+
rectangle() noexcept : m_first({0, 0}), m_second({0, 0})
3737
{
3838
}
3939

libs/EXTERNAL/libtatum/libtatum/tatum/util/tatum_strong_id.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ template<typename tag, typename T, T sentinel>
161161
bool operator!=(const StrongId<tag,T,sentinel>& lhs, const StrongId<tag,T,sentinel>& rhs);
162162

163163
template<typename tag, typename T, T sentinel>
164-
bool operator<(const StrongId<tag,T,sentinel>& lhs, const StrongId<tag,T,sentinel>& rhs);
164+
bool operator<(const StrongId<tag,T,sentinel>& lhs, const StrongId<tag,T,sentinel>& rhs) noexcept;
165165

166166

167167
//Class template definition with default template parameters
@@ -198,7 +198,7 @@ class StrongId {
198198
// after the function name (i.e. <>)
199199
friend bool operator== <>(const StrongId<tag,T,sentinel>& lhs, const StrongId<tag,T,sentinel>& rhs);
200200
friend bool operator!= <>(const StrongId<tag,T,sentinel>& lhs, const StrongId<tag,T,sentinel>& rhs);
201-
friend bool operator< <>(const StrongId<tag,T,sentinel>& lhs, const StrongId<tag,T,sentinel>& rhs);
201+
friend bool operator< <>(const StrongId<tag,T,sentinel>& lhs, const StrongId<tag,T,sentinel>& rhs) noexcept;
202202
private:
203203
T id_;
204204
};
@@ -215,7 +215,7 @@ bool operator!=(const StrongId<tag,T,sentinel>& lhs, const StrongId<tag,T,sentin
215215

216216
//Needed for std::map-like containers
217217
template<typename tag, typename T, T sentinel>
218-
bool operator<(const StrongId<tag,T,sentinel>& lhs, const StrongId<tag,T,sentinel>& rhs) {
218+
bool operator<(const StrongId<tag,T,sentinel>& lhs, const StrongId<tag,T,sentinel>& rhs) noexcept {
219219
return lhs.id_ < rhs.id_;
220220
}
221221

libs/libarchfpga/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ target_link_libraries(libarchfpga
2626

2727
if(${VTR_ENABLE_CAPNPROTO})
2828
target_link_libraries(libarchfpga libvtrcapnproto)
29+
find_package(ZLIB REQUIRED)
30+
target_link_libraries(libarchfpga ZLIB::ZLIB)
2931
target_compile_definitions(libarchfpga PRIVATE VTR_ENABLE_CAPNPROTO)
3032
endif()
3133

libs/libarchfpga/src/cad_types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ struct t_pack_patterns {
104104
std::vector<std::vector<t_pb_graph_pin*>> chain_root_pins;
105105

106106
// default constructor initializing to an invalid pack pattern
107-
t_pack_patterns() {
107+
t_pack_patterns() noexcept {
108108
name = nullptr;
109109
index = -1;
110110
root_block = nullptr;

libs/libarchfpga/src/parse_switchblocks.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,15 @@
44
*
55
*
66
* A large chunk of this file is dedicated to helping parse the initial switchblock
7-
* specificaiton in the XML arch file, providing error checking, etc.
7+
* specification in the XML arch file, providing error checking, etc.
88
*
99
* Another large chunk of this file is dedicated to parsing the actual formulas
1010
* specified by the switch block permutation functions into their numeric counterparts.
1111
*/
1212

13-
#include <string.h>
13+
#include <cstring>
1414
#include <string>
15-
#include <sstream>
1615
#include <vector>
17-
#include <stack>
18-
#include <utility>
19-
#include <algorithm>
2016

2117
#include "vtr_assert.h"
2218
#include "vtr_util.h"
@@ -26,9 +22,7 @@
2622

2723
#include "arch_error.h"
2824

29-
#include "read_xml_util.h"
3025
#include "arch_util.h"
31-
#include "arch_types.h"
3226
#include "physical_types.h"
3327
#include "parse_switchblocks.h"
3428

libs/libarchfpga/src/physical_types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ enum class e_sb_type;
9595
// Metadata value storage.
9696
class t_metadata_value {
9797
public:
98-
explicit t_metadata_value(vtr::interned_string v)
98+
explicit t_metadata_value(vtr::interned_string v) noexcept
9999
: value_(v) {}
100100
explicit t_metadata_value(const t_metadata_value& o) noexcept
101101
: value_(o.value_) {}

libs/librrgraph/src/base/rr_graph_utils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ struct t_pin_chain_node {
2121
int nxt_node_idx = OPEN;
2222

2323
t_pin_chain_node() = default;
24-
t_pin_chain_node(int pin_num, int nxt_idx)
24+
t_pin_chain_node(int pin_num, int nxt_idx) noexcept
2525
: pin_physical_num(pin_num)
2626
, nxt_node_idx(nxt_idx) {}
2727
};

0 commit comments

Comments
 (0)