From: Douglas Gregor (gregod_at_[hidden])
Date: 2002-07-17 07:16:06
On Wednesday 17 July 2002 01:42 am, Eric Friedman wrote:
> I have found that using declarations cannot be used in class templates
> on certain compilers as in the following example:
> So far, I have discovered that Visual C++ 7 (and undoubtedly 6.5 as
> well) and GCC 2.9.5 are not able to compile this (correct) code.
> I therefore propose that a new config macro be added to the appropriate
> compiler config headers. As a suggestion,
> BOOST_NO_CLASS_TEMPLATE_USING_DECLARATIONS seems an appropriate and
> descriptive name.
> Comments? Who is the person who would be able to make the changes to the
> config headers (if the time comes)? And what other compilers suffer from
> the same bug?
I'm not sure the macro name is appropriate, because at least on GCC 2.99.3 the
problem is unrelated to templates. Removing all of the templates from the
example, GCC 2.95.3 emits the error:
cannot adjust access to `static void test_base::f()' in `struct test_using'
because of local method `static double test_using::f(double)' with same name
The problem is that it can't overload a name introduced in the class and
brought in via a using declaration. Maybe
(I didn't check the reason for the failure on MSVC)
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk