Skip to content

Commit 28b4009

Browse files
committed
avoid bugprone-exception-escape in Macro copy constructor
1 parent 13dd45a commit 28b4009

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

simplecpp.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1509,7 +1509,12 @@ namespace simplecpp {
15091509
}
15101510

15111511
Macro(const Macro &other) : nameTokDef(nullptr), files(other.files), tokenListDefine(other.files), valueDefinedInCode_(other.valueDefinedInCode_) {
1512-
*this = other;
1512+
// TODO: remove the try-catch - see #537
1513+
// avoid bugprone-exception-escape clang-tidy warning
1514+
try {
1515+
*this = other;
1516+
}
1517+
catch (const Error&) {} // NOLINT(bugprone-empty-catch)
15131518
}
15141519

15151520
~Macro() {

0 commit comments

Comments
 (0)