[pcre-dev] [Bug 2084] New: C++: Guard 'using std::' directiv…

Top Page
Delete this message
Author: admin
Date:  
To: pcre-dev
Subject: [pcre-dev] [Bug 2084] New: C++: Guard 'using std::' directives with namespace pcrecpp
https://bugs.exim.org/show_bug.cgi?id=2084

            Bug ID: 2084
           Summary: C++: Guard 'using std::' directives with namespace
                    pcrecpp
           Product: PCRE
           Version: 8.40
          Hardware: All
                OS: All
            Status: NEW
          Severity: bug
          Priority: medium
         Component: Code
          Assignee: ph10@???
          Reporter: irfanadilovic@???
                CC: pcre-dev@???


Created attachment 1008
--> https://bugs.exim.org/attachment.cgi?id=1008&action=edit
Patch to guard 'using std::' directives with namespace pcrecpp

These three 'using' directives in pcre_stringpiece.h.in:

using std::memcmp;
using std::strlen;
using std::string;

are in the global namespace and thus propagate to all files including
pcre_stringpiece.h directly or indirectly, which may cause name clashes with
locally visible identifiers.

Attached is a trivial fix to guard these directives with the namespace pcrecpp.
The 'using std::string' directive is added to 3 unit test source files that
relied on the global using directive from the header file.

--
You are receiving this mail because:
You are on the CC list for the bug.