Skip to content

Commit

Permalink
Avoid mutating noexcept qualifiers.
Browse files Browse the repository at this point in the history
  • Loading branch information
afd committed Nov 11, 2023
1 parent b451076 commit 0abae3c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/libdredd/src/mutate_visitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,12 @@ bool MutateVisitor::TraverseDecl(clang::Decl* decl) {
}

bool MutateVisitor::TraverseStmt(clang::Stmt* stmt) {
// Do not mutate under a constant expression, since mutation logic is
// inherently non-constant.
if (stmt != nullptr && llvm::dyn_cast<clang::ConstantExpr>(stmt) != nullptr) {
return true;
}

// Add a node to the mutation tree to capture any mutations beneath this
// statement.
const PushMutationTreeRAII push_mutation_tree(*this);
Expand Down
1 change: 1 addition & 0 deletions test/single_file/noexcept.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
void foo() noexcept(true);
1 change: 1 addition & 0 deletions test/single_file/noexcept.cc.expected
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
void foo() noexcept(true);
1 change: 1 addition & 0 deletions test/single_file/noexcept.cc.noopt.expected
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
void foo() noexcept(true);

0 comments on commit 0abae3c

Please sign in to comment.