Skip to content

Commit 748b991

Browse files
committed
Fix unused variable with --disable-exceptions
1 parent d85a305 commit 748b991

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

tests/geom/which_node_am_i_test.C

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,10 @@ public:
114114
// Test the libmesh_asserts when they are enabled and exceptions
115115
// are available. If exceptions aren't available, libmesh_assert
116116
// simply aborts, so we can't unit test in that case.
117-
const Elem & prism6 = ReferenceElem::get(PRISM6);
118117
#if !defined(NDEBUG) && defined(LIBMESH_ENABLE_EXCEPTIONS)
119118
try
120119
{
120+
const Elem & prism6 = ReferenceElem::get(PRISM6);
121121
// Avoid sending confusing error messages to the console.
122122
StreamRedirector stream_redirector;
123123

@@ -136,8 +136,11 @@ public:
136136

137137
#ifdef NDEBUG
138138
// In optimized mode, we expect to get the "dummy" value 99.
139-
unsigned int n = prism6.local_side_node(0, 3);
140-
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(99), n);
139+
{
140+
const Elem & prism6 = ReferenceElem::get(PRISM6);
141+
unsigned int n = prism6.local_side_node(0, 3);
142+
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned int>(99), n);
143+
}
141144
#endif
142145

143146
// Test the Prism15 midedge nodes.

0 commit comments

Comments
 (0)