This is an archive of the discontinued LLVM Phabricator instance.

[DebugInfo][InstrRef] Fix Wdangling-else warning in InstrRefLDVTest
ClosedPublic

Authored by lbenes on Oct 18 2021, 5:52 PM.

Details

Summary

Fix a dangling else that gcc-11 warned about. The EXPECT_EQ macro
expands to an if-else, so the whole construction contains a hidden
dangling else.

Diff Detail

Event Timeline

lbenes requested review of this revision.Oct 18 2021, 5:52 PM
lbenes created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptOct 18 2021, 5:52 PM
lbenes edited the summary of this revision. (Show Details)Oct 18 2021, 5:53 PM
lbenes edited the summary of this revision. (Show Details)Oct 18 2021, 5:55 PM
jmorse accepted this revision.Oct 19 2021, 2:11 AM

Nice catch, thanks -- I suppose googletest or wherever EXPECT_EQ comes from should have the do {...}while(0) construct wrapping it, but that's way outside my wheelhouse.

(Landing this as you suggested elsewhere).

This revision is now accepted and ready to land.Oct 19 2021, 2:11 AM