Skip to content

Commit d6e9865

Browse files
authored
Merge pull request #8872 from The-OpenROAD-Project-staging/c++20
Upgrade to C++20
2 parents 3e09946 + 7e3aaa9 commit d6e9865

File tree

15 files changed

+29
-29
lines changed

15 files changed

+29
-29
lines changed

.bazelrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ test --test_timeout=300,1800,1800,9600
1212
# match, but bazel 8 will be strict. So start now.
1313
common --incompatible_disallow_empty_glob
1414

15-
build --cxxopt "-std=c++17" --host_cxxopt "-std=c++17"
15+
build --cxxopt "-std=c++20" --host_cxxopt "-std=c++20"
1616
build --cxxopt "-xc++" --host_cxxopt "-xc++"
1717
build --cxxopt "-DBAZEL_BUILD" --host_cxxopt "-DBAZEL_BUILD"
1818

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ set(OPENROAD_HOME ${PROJECT_SOURCE_DIR})
5959
set(OPENROAD_SHARE ${CMAKE_INSTALL_PREFIX}/share/openroad)
6060

6161
# Default c++ standard used unless otherwise specified in target_compile_features.
62-
set(CMAKE_CXX_STANDARD 17 CACHE STRING "the C++ standard to use for this project")
62+
set(CMAKE_CXX_STANDARD 20 CACHE STRING "the C++ standard to use for this project")
6363
set(CMAKE_CXX_STANDARD_REQUIRED ON)
6464
# Disable compiler specific extensions like gnu++11.
6565
set(CMAKE_CXX_EXTENSIONS OFF)

src/dbSta/src/dbNetwork.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2313,7 +2313,7 @@ void dbNetwork::makeTopCell()
23132313
for (dbBTerm* bterm : block_->getBTerms()) {
23142314
makeTopPort(bterm);
23152315
}
2316-
groupBusPorts(top_cell_, [=](const char* port_name) {
2316+
groupBusPorts(top_cell_, [=, this](const char* port_name) {
23172317
return portMsbFirst(port_name, design_name);
23182318
});
23192319

src/gui/src/chartsWidget.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -875,7 +875,7 @@ void HistogramView::emitEndPointsInBucket(const int bar_index)
875875
return;
876876
}
877877

878-
auto compare_slack = [=](const sta::Pin* a, const sta::Pin* b) {
878+
auto compare_slack = [this](const sta::Pin* a, const sta::Pin* b) {
879879
return sta_->getPinSlack(a) < sta_->getPinSlack(b);
880880
};
881881
std::sort(end_points.begin(), end_points.end(), compare_slack);

src/gui/src/clockWidget.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -822,7 +822,7 @@ ClockTreeView::ClockTreeView(std::shared_ptr<ClockTree> tree,
822822
&ClockTreeScene::clearPath,
823823
this,
824824
&ClockTreeView::clearHighlightTo);
825-
connect(scene_, &ClockTreeScene::save, [=] { save(); });
825+
connect(scene_, &ClockTreeScene::save, [this] { save(); });
826826
connect(scene_,
827827
&ClockTreeScene::colorDepth,
828828
this,
@@ -1571,7 +1571,7 @@ ClockWidget::ClockWidget(QWidget* parent)
15711571
container->setLayout(layout);
15721572
setWidget(container);
15731573

1574-
connect(update_button_, &QPushButton::clicked, [=] { populate(); });
1574+
connect(update_button_, &QPushButton::clicked, [this] { populate(); });
15751575
connect(fit_button_, &QPushButton::clicked, this, &ClockWidget::fit);
15761576

15771577
update_button_->setEnabled(false);

src/gui/src/mainWindow.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,9 @@ MainWindow::MainWindow(bool load_settings, QWidget* parent)
210210
connect(this, &MainWindow::rulersChanged, viewers_, &LayoutTabs::fullRepaint);
211211
connect(this, &MainWindow::labelsChanged, viewers_, &LayoutTabs::fullRepaint);
212212

213-
connect(controls_, &DisplayControls::selected, [=](const Selected& selected) {
214-
setSelected(selected);
215-
});
213+
connect(controls_,
214+
&DisplayControls::selected,
215+
[this](const Selected& selected) { setSelected(selected); });
216216

217217
connect(inspector_,
218218
&Inspector::selected,
@@ -250,12 +250,12 @@ MainWindow::MainWindow(bool load_settings, QWidget* parent)
250250
&Inspector::loadActions);
251251
connect(inspector_,
252252
&Inspector::removeHighlight,
253-
[=](const QList<const Selected*>& selected) {
253+
[this](const QList<const Selected*>& selected) {
254254
removeFromHighlighted(selected);
255255
});
256256
connect(inspector_,
257257
&Inspector::addHighlight,
258-
[=](const SelectionSet& selected) { addHighlighted(selected); });
258+
[this](const SelectionSet& selected) { addHighlighted(selected); });
259259
connect(
260260
inspector_, &Inspector::setCommand, script_, &ScriptWidget::setCommand);
261261
connect(script_,
@@ -269,14 +269,14 @@ MainWindow::MainWindow(bool load_settings, QWidget* parent)
269269

270270
connect(hierarchy_widget_,
271271
&BrowserWidget::select,
272-
[=](const SelectionSet& selected) { setSelected(selected); });
272+
[this](const SelectionSet& selected) { setSelected(selected); });
273273
connect(hierarchy_widget_,
274274
&BrowserWidget::removeSelect,
275275
this,
276276
&MainWindow::removeSelected);
277277
connect(hierarchy_widget_,
278278
&BrowserWidget::highlight,
279-
[=](const SelectionSet& selected) { addHighlighted(selected); });
279+
[this](const SelectionSet& selected) { addHighlighted(selected); });
280280
connect(hierarchy_widget_,
281281
&BrowserWidget::removeHighlight,
282282
this,
@@ -337,13 +337,13 @@ MainWindow::MainWindow(bool load_settings, QWidget* parent)
337337

338338
connect(selection_browser_,
339339
&SelectHighlightWindow::clearHighlightedItems,
340-
[=](const QList<const Selected*>& selected) {
340+
[this](const QList<const Selected*>& selected) {
341341
removeFromHighlighted(selected);
342342
});
343343

344344
connect(selection_browser_,
345345
&SelectHighlightWindow::highlightSelectedItemsSig,
346-
[=](const QList<const Selected*>& items) {
346+
[this](const QList<const Selected*>& items) {
347347
updateHighlightedSet(items);
348348
});
349349

src/gui/src/timingWidget.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ void TimingWidget::setColumnDisplayMenu()
131131
action->setCheckable(true);
132132
action->setChecked(true);
133133

134-
connect(action, &QAction::triggered, this, [=](bool checked) {
134+
connect(action, &QAction::triggered, this, [=, this](bool checked) {
135135
hideColumn(column_index, checked);
136136
});
137137

src/mpl/src/object.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ struct BundledNet
502502
this->weight = weight;
503503
}
504504

505-
bool operator==(const BundledNet& net)
505+
bool operator==(const BundledNet& net) const
506506
{
507507
return (terminals.first == net.terminals.first)
508508
&& (terminals.second == net.terminals.second);

src/rsz/src/BaseMove.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@ LibertyCell* BaseMove::upsizeCell(LibertyPort* in_port,
637637
const char* in_port_name = in_port->name();
638638
const char* drvr_port_name = drvr_port->name();
639639
sort(swappable_cells,
640-
[=](const LibertyCell* cell1, const LibertyCell* cell2) {
640+
[=, this](const LibertyCell* cell1, const LibertyCell* cell2) {
641641
LibertyPort* port1
642642
= cell1->findLibertyPort(drvr_port_name)->cornerPort(lib_ap);
643643
LibertyPort* port2

src/rsz/src/CloneMove.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ bool CloneMove::doMove(const Path* drvr_path,
142142

143143
sort(fanout_slacks.begin(),
144144
fanout_slacks.end(),
145-
[=](const pair<Vertex*, Slack>& pair1,
146-
const pair<Vertex*, Slack>& pair2) {
145+
[this](const pair<Vertex*, Slack>& pair1,
146+
const pair<Vertex*, Slack>& pair2) {
147147
return (pair1.second > pair2.second
148148
|| (pair1.second == pair2.second
149149
&& network_->pathNameLess(pair1.first->pin(),

0 commit comments

Comments
 (0)