$ hg clone http://code.nsnam.org/ns-3-dev $ cd ns-3-dev Now, compiling in debug mode works fine: $ ./waf configure $ ./waf build But compiling in optimized mode fails: $ ./waf configure -d optimized $ ./waf build Waf: Entering directory `/home/vedranm/workspace/ns-3-allinone/ns-3-dev/build' [1608/1955] Compiling src/lte/model/epc-mme.cc In file included from ../src/lte/model/epc-mme.cc:25:0: ../src/lte/model/epc-s11-sap.h: In member function „void ns3::EpcMme::DoInitialUeMessage(uint64_t, uint16_t, uint64_t, uint16_t)”: ../src/lte/model/epc-s11-sap.h:183:10: greška: „msg.ns3::EpcS11SapSgw::CreateSessionRequestMessage::<anonymous>” may be used uninitialized in this function [-Werror=maybe-uninitialized] struct CreateSessionRequestMessage : public GtpcMessage ^~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1plus: all warnings being treated as errors Waf: Leaving directory `/home/vedranm/workspace/ns-3-allinone/ns-3-dev/build' Build failed -> task in 'ns3-lte' failed (exit status 1): {task 139949836372048: cxx epc-mme.cc -> epc-mme.cc.1.o} ['/usr/lib64/ccache/g++', '-O3', '-g', '-Wall', '-Werror', '-march=native', '-fstrict-overflow', '-Wstrict-overflow=2', '-std=c++11', '-Wno-error=deprecated-declarations', '-fstrict-aliasing', '-Wstrict-aliasing', '-fPIC', '-pthread', '-I.', '-I..', '-I/usr/include/libxml2', '-DNS3_BUILD_PROFILE_OPTIMIZED', '-DHAVE_SYS_IOCTL_H=1', '-DHAVE_IF_NETS_H=1', '-DHAVE_NET_ETHERNET_H=1', '-DHAVE_PACKET_H=1', '-DHAVE_DL=1', '-DDL=1', '-DXML2=1', '-DHAVE_IF_TUN_H=1', '-DHAVE_GSL=1', '-DHAVE_SQLITE3=1', '-DHAVE_LIBXML2=1', '../src/lte/model/epc-mme.cc', '-c', '-o', '/home/vedranm/workspace/ns-3-allinone/ns-3-dev/build/src/lte/model/epc-mme.cc.1.o'] GCC 6 compiles both fine. Furthermore if in epc-mme.cc one replaces EpcS11SapSgw::CreateSessionRequestMessage msg; with EpcS11SapSgw::CreateSessionRequestMessage msg {}; the code compiles fine. All my attempts at getting a minimal example that exhibits the same behaviour have unfortunately failed. Should I provide the preprocessed source file?
Fixed in gcc-c++-7.2.1-2.fc26.x86_64.