Project

General

Profile

Bug #3343

Updated by Davide Pesavento over 8 years ago

The explicit specialization of `DummyClientFace::receive` for `lp::Nack` appears is defined only in `dummy-client-face.cpp`. the .cpp file. Users of the class will presumably include the corresponding header .hpp file instead, which does not declare contain any explicit specializations for the function template, specialization, thus the compiler will implicitly instantiate the "generic" version. version of `DummyClientFace::receive`. This invokes undefined behavior according to the ISO C++ standard (ยง14.7.3): 

 > If a template, a member template or a member of a class template is explicitly specialized then that specialization 
 > shall be declared before the first use of that specialization that would cause an implicit instantiation 
 > to take place, in every translation unit in which such a use occurs; no diagnostic is required.

Back