This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: /usr/include/c++/3.2/bits/basic_string.tcc:713: parse error before `(' token
- From: "Claudio Bley" <bley at cs dot uni-magdeburg dot de>
- To: Per Jessen <per at computer dot org>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Fri, 27 Sep 2002 14:28:49 +0200
- Subject: Re: /usr/include/c++/3.2/bits/basic_string.tcc:713: parse error before `(' token
- References: <564DE4477544D411AD2C00508BDF0B6A0C9DDB1D@usahm018.exmi01.exch.eds.com><3D9424A4.8060801@computer.org><3D94315A.5090300@computer.org>
>>>>> "Per" == Per Jessen <per@computer.org> writes:
Per> All, being new to this list, I don't know if is this the
Per> right place to ask, but here we go. I believe there is a
Per> problem in /usr/include/c++/3.2/bits/basic_string.tcc - see
Per> excerpt from a listing below.
Per> Line 713 reads
Per> __pos = std::min(__size - __n, __pos);
Per> but I believe this should be
Per> __pos = min(__size - __n, __pos);
Per> Am I right in thinking that min is a macro and not part of
Per> the "std" namespace ? I saw some discussion related to this
Per> on gcc-bugs, but I didn't see anyone actually calling it a
Per> bug. Or am I doing something wrong ?
Possibly the latter. It is no macro (in C++), it is a templated
function. It's defined in /usr/include/c++/3.2/bits/stl_algobase.h:
template<typename _Tp>
inline const _Tp&
min(const _Tp& __a, const _Tp& __b)
{
// concept requirements
__glibcpp_function_requires(_LessThanComparableConcept<_Tp>)
//return __b < __a ? __b : __a;
if (__b < __a) return __b; return __a;
}
And it is indeed defined in namespace std.
>> > > In file included from /usr/include/c++/3.2/string:57, >
>> from LVCSim_liveCacheSink.cpp:60: >
>> /usr/include/c++/3.2/bits/basic_string.tcc: In member function
>> > `_Alloc::size_type std::basic_string<_CharT, _Traits, >
>> _Alloc>::rfind(const _CharT*, _Alloc::size_type,
>> _Alloc::size_type) const': >
>> /usr/include/c++/3.2/bits/basic_string.tcc:713: parse error
>> before `(' token
>> >
>> > The line at 713 is this: > __pos = std::min(__size - __n,
>> __pos);
>>
You are not by any chance trying to compile a Qt/KDE application? Just
have a look at the preprocessed code (use cpp instead of g++) at this
location. How does it look like? And what's the command you've used to
compile this file?
--
Claudio Bley ASCII ribbon campaign (")
Debian GNU/Linux advocate - against HTML email X
http://www.cs.uni-magdeburg.de/~bley/ & vCards / \