[Everyone!] VC 7.1: "'detail' : ambiguous symbol"

I've been doing battle with VC 7.1 and its "'detail' : ambiguous symbol" error messages for a while. The basic problem is that we have a file with, essentially, "using namespace boost; using namespace boost::spirit;" in it. Since VC 7.1 resolves namespace names a bit strangely, these using directives end up being resolved late in the compilation process, so they make lookups of names like "detail" ambiguous. The most recent of these problems shows up here: http://tinyurl.com/a4d6p Using directives from some Graph code that #includes spirit and shared_ptr has the using directives I mentioned above. All should be well, but somehow VC 7.1 is using these directives later on, so shared_ptr's reference to "detail::" becomes ambiguous. I've been whacking these problems by providing full qualification (::boost::detail) where it concerns my libraries, but now that it's hit shared_ptr I think we might need to fix this another way. A few options come to mind: 1) Make me fix the graph library with a bunch of using declarations instead of the blanket "using namespace boost::spirit;" that causes the problem. But, users might still run into this issue. 2) Keep on qualifying "detail" references until it stops causing problems 3) Stop using "detail" and instead use "[lib]_detail" that is different for each lib. Preferences? Doug

Douglas Gregor wrote:
I've been doing battle with VC 7.1 and its "'detail' : ambiguous symbol" error messages for a while. The basic problem is that we have a file with, essentially, "using namespace boost; using namespace boost::spirit;" in it. Since VC 7.1 resolves namespace names a bit strangely, these using directives end up being resolved late in the compilation process, so they make lookups of names like "detail" ambiguous. The most recent of these problems shows up here:
That's the problem two-phase lookup was designed to solve...
1) Make me fix the graph library with a bunch of using declarations instead of the blanket "using namespace boost::spirit;" that causes the problem. But, users might still run into this issue. 2) Keep on qualifying "detail" references until it stops causing problems 3) Stop using "detail" and instead use "[lib]_detail" that is different for each lib.
As much as I hate it, (2) seems the only viable option.

"Peter Dimov" <pdimov@mmltd.net> writes:
1) Make me fix the graph library with a bunch of using declarations instead of the blanket "using namespace boost::spirit;" that causes the problem. But, users might still run into this issue. 2) Keep on qualifying "detail" references until it stops causing problems 3) Stop using "detail" and instead use "[lib]_detail" that is different for each lib.
As much as I hate it, (2) seems the only viable option.
I sorta think 3 is a reasonable possibility. I found all the details to be a problem in Boost.Python, which has multiple subnamespaces. -- Dave Abrahams Boost Consulting www.boost-consulting.com

I've been doing battle with VC 7.1 and its "'detail' : ambiguous symbol" error messages for a while. The basic problem is that we have a file with, essentially, "using namespace boost; using namespace boost::spirit;" in it. Since VC 7.1 resolves namespace names a bit strangely, these using directives end up being resolved late in the compilation process, so they make lookups of names like "detail" ambiguous.
Confirmed. I got multiple ambiguous detail errors when compiling my program on VC 8.0 Beta2 with most recent boost::spirit. Boost 1.32 did not seem to have that problem though. I solved that in dirty way by extra-qualifying all places where detail ambiguity error occured in my local copy of boost... That was also the reason I posted question about 'detail' namespace conflicts a couple of weeks ago. cheers, Marcin
participants (4)
-
David Abrahams
-
Douglas Gregor
-
Marcin Kalicinski
-
Peter Dimov