Project

General

Profile

Actions

Bug #5144

closed

virtual method compile() called from NdnRegexTopMatcher constructor

Added by Anonymous almost 4 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Low
Category:
Utils
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
1.50 h

Description

The base class RegexMatcher declares the pure virtual method compile(). Derived classes like NdnRegexTopMatcher override compile(). Furthermore, then call compile() in the constructor.

One of my code safety tools is complaining about this. Calling a virtual method from a constructor can have undefined results. As far as I can tell, RegexMatcher does not need to declare that compile() is a virtual method. No code calls it directly. As a test, I commented it out, and in the derived classes I removed the "override" tag from the compile() method. ./waf does not report any errors.

Do you agree that compile() does not need to be declared in the base class RegexMatcher? If so, then it can be removed to fix the warning about calling a virtual method from a constructor.

Actions

Also available in: Atom PDF