Now config macro : BOOST_NO_TWO_PHASE_NAME_LOOKUP

I have just supplied John with a new defect macro and test case to detect compilers that (do not) support 2-phase name lookup with templates, but it would be really helpful if someone who is more familiar with the problem (and access to conforming compilers!) can verify the test for us! The test case is in boost/libs/config/boost_no_two_phase_name_lookup.ipp and currently the code looks like: template< class T > struct base { int call() { return 1; } }; int call() { return 0; } template< class T > struct derived : base< T > { int call_test() { return call(); } }; int test() { derived< int > d; return d.call_test(); } I believe a conforming compiler should only find the 'free' function, where a broken compiler will typically call the function from its base class template. Also, beware of config test failures until the various compiler config headers are updated. This should also give us a good idea of whether the right compilers are being flagged! -- AlisdairM

"AlisdairM" <alisdair.meredith@uk.renaultf1.com> writes:
I have just supplied John with a new defect macro and test case to detect compilers that (do not) support 2-phase name lookup with templates, but it would be really helpful if someone who is more familiar with the problem (and access to conforming compilers!) can verify the test for us!
Looks like the test case and your analysis are right. -- Dave Abrahams Boost Consulting www.boost-consulting.com

Just to complete our catalog of name lookup breakage: MSVC <=8's unqualified lookup will incorrectly find a dependent name in a base class (not a big deal - just something to be aware of because it can lead to unportable code if developing with this compiler). GCC's qualified lookup OTOH refused to find dependent names from base classes in some situations (that bug got fixed recently). http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27787 Regards, Tobias

Alisdair Meredith wrote:
[...] it would be really helpful if someone who is more familiar with the problem (and access to conforming compilers!) can verify the test for us!
For aCC6 on HP-UX/ia64 and cxx on Tru64 and VMS it is configurable: they exhibit the standard-conforming behaviour in a strict ansi mode and non-standard-conforming behaviour in the default mode -- see below for Unix'es. Is it expected that BOOST_NO_TWO_PHASE_NAME_LOOKUP macro is defined in boost configuration file for the particular compiler? I think so, just want to be sure. Thanks, Boris $ aCC -V aCC: HP aC++/ANSI C B3910B A.06.10 [Mar 22 2006] $ aCC no_two_phase_name_lookup.cpp && (a.out ; echo $?) 1 $ aCC no_two_phase_name_lookup.cpp +strict && (a.out ; echo $?) 0 $ $ cxx -V Compaq C++ V7.1-006 for Compaq Tru64 UNIX V5.1B (Rev. 2650) Compiler Driver V7.1-006 (cxx) cxx Driver $ cxx no_two_phase_name_lookup.cpp && (a.out ; echo $?) 1 $ cxx no_two_phase_name_lookup.cpp -std strict_ansi && (a.out ; echo $?) 0 $
participants (4)
-
AlisdairM
-
Boris Gubenko
-
David Abrahams
-
Tobias Schwinger