Opened 13 years ago

Closed 13 years ago

#3305 closed Bugs (worksforme)

BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS should be defined for gcc 3.4.x

Reported by: Christopher Schmidt Owned by: John Maddock
Milestone: Boost 1.40.0 Component: config
Version: Boost Development Trunk Severity: Problem
Keywords: Cc: Christopher Schmidt

Description

The attached piece of code fails to compile under gcc 3.4.2 (MinGW official). Output:

test.cpp:3:3: #error BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS not defined! test.cpp: In function `int main()': test.cpp:13: error: call of overloaded `F(const int&)' is ambiguous test.cpp:6: note: candidates are: void F(C&) [with int i = 0, C = const int] test.cpp:7: note: void F(const C&) [with int i = 0, C = int]

I think BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS should be defined for this compiler version. At the moment, Boost.Config just defines BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS for gcc 3.1.x and 3.2.x .

Attachments (1)

test.cpp (302 bytes ) - added by Christopher Schmidt 13 years ago.
testcase

Download all attachments as: .zip

Change History (6)

by Christopher Schmidt, 13 years ago

Attachment: test.cpp added

testcase

comment:1 by John Maddock, 13 years ago

Status: newassigned

I'm not sure if that is *exactly* the use case that that macro was intended for - is there a specific use case within Boost that requires this? I'm asking because I'd rather not disable features (or whole libraries in the case of Boost.Units) for gcc-3.4 unless we really have to.

Thanks, John.

comment:2 by Christopher Schmidt, 13 years ago

I need a macro that describes that defect for my work on Boost.Fusion. At the moment, this problem is workarounded by the general use of boost::lazy_disable_if (e.g. https://svn.boost.org/trac/boost/browser/trunk/boost/fusion/sequence/intrinsic/at.hpp#L70). Of course I can still live with a general lazy_disable_if, but unfortunately this is not fast in terms of compile time and neither looks nor feels right.

comment:3 by Christopher Schmidt, 13 years ago

Cc: Christopher Schmidt added

comment:4 by John Maddock, 13 years ago

The thing is if we change this, then it'll make Boost::Units unusable on cygwin (and maybe other libraries too).

Can you not use something like:

#if defined(BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS)
BOOST_WORKAROUND(GNUC, <4)

workaround here #else conforming code #endif

?

comment:5 by Christopher Schmidt, 13 years ago

Resolution: worksforme
Status: assignedclosed

A hardcoded BOOST_WORKAROUND looks reasonable to me. I am fine with this.

Note: See TracTickets for help on using tickets.