Skip to content

Commit

Permalink
(Rosebud) Fixed warnings when NDEBUG is defined
Browse files Browse the repository at this point in the history
RPM-357
  • Loading branch information
matzke1 committed Apr 18, 2023
1 parent 0733bba commit dfb9b9c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/ROSETTA/Grammar/Node.code
Original file line number Diff line number Diff line change
Expand Up @@ -1886,6 +1886,7 @@ public:
T* initParentPointer(T *child, SgNode *parent) {
ASSERT_not_null(parent);
if (child) {
#ifndef NDEBUG
auto toString = [](SgNode *node) {
if (node) {
return (boost::format("(%s*)%p") % node->class_name() % node).str();
Expand All @@ -1898,6 +1899,7 @@ public:
"child " + toString(child) +
" cannot be inserted into " + toString(parent) +
" because it is already a child of " + toString(child->get_parent()));
#endif
child->set_parent(this);
}
return child;
Expand Down Expand Up @@ -1944,13 +1946,15 @@ public:
std::is_pointer<T>::value,
void>::type
changeChildPointer(T& edge, T const& child) {
#ifndef NDEBUG
auto toString = [](SgNode *node) {
if (node) {
return (boost::format("(%s*)%p") % node->class_name() % node).str();
} else {
return std::string("nullptr");
}
};
#endif

if (child != edge) {
// If there is an old child, check that it has the correct parent and then remove it.
Expand Down

0 comments on commit dfb9b9c

Please sign in to comment.