Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 333317

Summary: Parser cannot deduce conversion from std::streampos to std::streamoff under Linux
Product: [Tools] CDT Reporter: Nathan Ridge <zeratul976>
Component: cdt-indexerAssignee: Project Inbox <cdt-indexer-inbox>
Status: RESOLVED FIXED QA Contact: Markus Schorn <mschorn.eclipse>
Severity: normal    
Priority: P3 CC: cdtdoug, yevshif
Version: 8.0   
Target Milestone: 8.0   
Hardware: PC   
OS: Linux   
Whiteboard:

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.