Bug #3343
closedExplicit specialization of DummyClientFace::receive<lp::Nack> relies on undefined behavior
100%
Description
The explicit specialization of DummyClientFace::receive
for lp::Nack
appears only in dummy-client-face.cpp
. Users of the class will presumably include the corresponding header file instead, which does not declare any explicit specializations for the function template, thus the compiler will implicitly instantiate the "generic" version. 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.
Updated by Davide Pesavento almost 9 years ago
Obviously the solution is to declare the explicit specialization in dummy-client-face.hpp
Updated by Junxiao Shi almost 9 years ago
- Assignee set to Eric Newberry
- Target version set to v0.4
- Estimated time set to 0.50 h
I agree with note-2 solution.
Updated by Eric Newberry almost 9 years ago
- Status changed from New to In Progress
Updated by Eric Newberry almost 9 years ago
- Status changed from In Progress to Code review
Updated by Davide Pesavento almost 9 years ago
- Status changed from Code review to Closed
- % Done changed from 0 to 100