Project

General

Profile

Actions

Bug #3343

closed

Explicit specialization of DummyClientFace::receive<lp::Nack> relies on undefined behavior

Added by Davide Pesavento over 8 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Utils
Target version:
Start date:
11/17/2015
Due date:
% Done:

100%

Estimated time:
0.50 h

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.

Actions

Also available in: Atom PDF