http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51083

             Bug #: 51083
           Summary: gnu++0x: resolving overloaded functions belonging to
                    different namespaces
    Classification: Unclassified
           Product: gcc
           Version: 4.6.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: jochenzimmerm...@gmx.de


Hi,

I'm using gcc 4.6.2 on Mac OS 10.6. 
When using the gnu++0x flag gcc fails to compile the attached (preprocessed)
source, otherwise everything works as expected.

I am using a math library called 'armadillo' which overloads functions already
present in namespace std, eg std::imag() and arma::imag().
As long as one specifies the namespace explicitly the code compiles. However,
the following does not work:

using namespace std;
using namespace arma;

imag(std::foo);
imag(arma::bar); // <- compile error

I call the compiler with the following commands:
g++-mp-4.6 -I/usr/local/include -O0 -g3 -Wall -c -fmessage-length=0
-std=gnu++0x  -fno-strict-aliasing -fwrapv -save-temps -MMD -MP -MF"main.d"
-MT"main.d" -o "main.o" "../main.cpp"

The error message:
error: conversion from '__gnu_cxx::__promote<arma::Mat<std::complex<double> >,
false>::__type {aka arma::Mat<std::complex<double> >}' to non-scalar type
'arma::mat {aka arma::Mat<double>}' requested

Reply via email to