Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2002-11-28 20:11:04


Beman Dawes <bdawes_at_[hidden]> writes:

> At 11:38 AM 11/26/2002, Samuel Krempp wrote:
>
> >So I can only look at the daily regression results..
>
> Since you are looking at the results, you might whack away at the Metrowerks errors (see below).
>
> The error "undefined identifier" on an identifier other compilers are finding is usually caused by
> Metrowerks correct implementation of two-phase name lookup detecting an error that is slipping by other
> compilers. The usual case I've seen is the need to qualify the name in questions with a templated class
> name (usually a base class name) (with parameters), although the problem you seem to be having is
> sometimes with an enum.
>
> AFAIK, Metrowerks is correct, and the other compilers intend to detect these errors in the future.
>
> The fix is usually to add qualification. For example, foo::out_of_range_bit.

The fix is usually to make sure that the appropriate declaration of a
non-dependent name is visible before the name is used. Extra
qualification doesn't usually help AFAICT.

Oh, I guess that if the name is a member of a base class, then the fix
is to write ``this->member_name'' or ``BaseClass::member_name''
instead of just ``member_name''. That can be viewed as adding
qualification. However, that doesn't _appear_ to be the problem in the
case below, and in any case I recomment using ``this->'' when possible
because it's more reliable.

-Dave

> Hope this helps,
>
> --Beman
>
> ### mwcc Compiler:
> # In: ..\boost\format\format_implementation.hpp
> # From: ..\libs\format\test\format_test1.cpp
> # ---------------------------------------------
> # 154: if( exceptions() & out_of_range_bit )
> # Error: ^^^^^^^^^^^^^^^^
> # undefined identifier 'out_of_range_bit'
> # (included from:
> # format.hpp:50
> # format_test1.cpp:1)
> ### mwcc Compiler:
> # 155: boost::throw_exception(out_of_range()); // arg not in range.
> # Error: ^
> # undefined identifier 'out_of_range'
> # (included from:
> # format.hpp:50
> # format_test1.cpp:1)

-- 
                       David Abrahams
   dave_at_[hidden] * http://www.boost-consulting.com
Boost support, enhancements, training, and commercial distribution

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk