Skip to content

Commit f595d1e

Browse files
committed
avoid bugprone-exception-escape in Macro copy constructor
1 parent 3d47522 commit f595d1e

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
@@ -1508,7 +1508,12 @@ namespace simplecpp {
15081508
}
15091509

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

15141519
~Macro() {

0 commit comments

Comments
 (0)