Skip to content

Commit 495a113

Browse files
committed
avoid bugprone-exception-escape in Macro copy constructor
1 parent 092f92f commit 495a113

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
@@ -1492,7 +1492,12 @@ namespace simplecpp {
14921492
}
14931493

14941494
Macro(const Macro &other) : nameTokDef(nullptr), files(other.files), tokenListDefine(other.files), valueDefinedInCode_(other.valueDefinedInCode_) {
1495-
*this = other;
1495+
// TODO: remove the try-catch
1496+
// avoid bugprone-exception-escape clang-tidy warning
1497+
try {
1498+
*this = other;
1499+
}
1500+
catch(const Error&) {}
14961501
}
14971502

14981503
~Macro() {

0 commit comments

Comments
 (0)