bugGNU Octave - Bugs: bug #34201, Build fail with -std=c++0x flag

 
 

bug #34201: Build fail with -std=c++0x flag

Submitted by:  Júlio Hoffimann Mendes <juliohm>
Submitted on:  Sat 03 Sep 2011 08:24:45 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Build Failure
Status: FixedAssigned to: None
Originator Name: juliohmOpen/Closed: Closed
Release: devOperating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Tue 06 Sep 2011 07:26:35 PM UTC, comment #3:

I'm not sure, but I think the problem is that we have both

and

We don't want to remove our template functions that match
"R fun (T)" and "R fun (const T&)" since those are separate and we want to handle both cases.

If adding a <TYPE> tag to the locations where std::conj is used avoids the problem, then I think that is OK. My tests showed that doing that works and g++ is calling the correct version of the function then. It's not clear to me why that is required for the compiler to resolve the function call, but adding it doesn't hurt as far as I can tell.

I checked in the following changeset, attributed to Júlio:

http://hg.savannah.gnu.org/hgweb/octave/rev/353c71c76f22

John W. Eaton <jwe>
Project Administrator
Tue 06 Sep 2011 02:35:51 PM UTC, comment #2:

Btw, this bug only seems to happen with g++ 4.5 or higher. I compile with 4.4, and I don't see this problem compiling with -std=c++0x. I am also therefore unable to test if the proposed fix by Júlio is correct.

Jordi Gutiérrez Hermoso <jordigh>
Project Administrator
Sun 04 Sep 2011 04:14:23 PM UTC, comment #1:

I'm attaching a smaller example extracted from Octave that also demonstrates the problem. It may be possible to further simplify it, but I don't have time at the moment. Compiling with the -std=c++0x option generates the ambiguity error. Leaving out that option allows the file to compile. I'm not sure whether this is a bug in g++ or a change in the way C++ resolves overloaded functions.

(file #23936)

John W. Eaton <jwe>
Project Administrator
Sat 03 Sep 2011 08:24:45 PM UTC, original submission:
Júlio Hoffimann Mendes <juliohm>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #23948:  c++0x.patch added by juliohm (4KiB - text/x-patch - This patch fixes the build, but makes octave/scripts/specfun/realpow.m test fail)
file #23936:  foo.cc added by jwe (2KiB - text/x-c++src)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jordigh (Posted a comment)
  • -unavailable- added by jwe (Updated the item)
  • -unavailable- added by juliohm (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 06 Sep 2011 07:26:35 PM UTCjweStatusNone=>Fixed
      Open/ClosedOpen=>Closed
    Mon 05 Sep 2011 09:54:26 PM UTCjuliohmAttached File-=>Added c++0x.patch, #23948
    Sun 04 Sep 2011 04:14:23 PM UTCjweAttached File-=>Added foo.cc, #23936

    Back to the top


    Powered by Savane 3.1-cleanup1