Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 333317 - Parser cannot deduce conversion from std::streampos to std::streamoff under Linux
Summary: Parser cannot deduce conversion from std::streampos to std::streamoff under L...
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-indexer (show other bugs)
Version: 8.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 8.0   Edit
Assignee: Project Inbox CLA
QA Contact: Markus Schorn CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-29 17:14 EST by Nathan Ridge CLA
Modified: 2012-01-05 00:56 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nathan Ridge CLA 2010-12-29 17:14:23 EST
The following code, which compiles fine, gives an error at the indicated line:

#include <string>

using std::streampos;
using std::streamoff;

void g(streamoff);

void f()
{
    streampos p;
    g(p);  // ERROR HERE
}

The error is "Invalid arguments Candidates are: void g(long long int)".

It seems the parser cannot deduce the conversion from streampos to streamoff. Such a conversion is valid (streampos is a typedef for fpos<mbstate>, and fpos has an operator streamoff()).

I think what is confusing the parser is that it cannot resolve mbstate, the template parameter to fpos.

I only experience this problem on Linux, it works fine on Windows. My compiler is gcc 4.5, OS is Ubuntu 10.04.
Comment 1 Nathan Ridge CLA 2012-01-04 21:52:34 EST
Tested again with Indigo release version, problem has gone away.
Comment 2 Markus Schorn CLA 2012-01-05 00:56:06 EST
Thanks for the update.