boostorg / boostorg/bimap

Clang-cl flags -Wmicrosoft-unqualified-friend warnings

Open
#19 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
26
Forks
49
PR merge metrics
No merged PRs in 30d

Description

In Boost 1.70 (and current master, but I don't have the line numbers handy), these lines spawn a warning:
> unqualified friend declaration referring to type outside of the nearest enclosing namespace is a Microsoft extension; add a nested name specifier
map_view_iterator.hpp:
87, 138, 174, 215, 252, 293, 329

It seems to me that simply adding a `::boost::iterators::` qualification will fix this issue. See e.g. https://kod.acikkaynak.gov.tr/libreoffice/core/commit/aef6da021da33f099f99ed633814b8771ad4abda which seems to "fix" the warning locally by disabling the warning.

You can try Clang-cl by installing the CLang-cl options in the VS2019 installer, and e.g. running CMake with `-T"ClangCL"`, or specifying the compiler manually using `-DCMAKE_CXX_COMPILER=path/to/clang-cl.exe`. You can also just use LLVM's version of clang-cl, it seems to be identical. Just make sure you have either VS2017 or VS2019 installed.

Contributor guide

No contributing guide indexed for this repository

Research direction

Inspect map_view_iterator.hpp at lines 87, 138, 174, 215, 252, 293, and 329, then reproduce the warnings with clang-cl through CMake. Verify that the affected declarations no longer emit -Wmicrosoft-unqualified-friend warnings under clang-cl.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.