hzhan0607 / cusp-library

Automatically exported from code.google.com/p/cusp-library
Apache License 2.0
0 stars 0 forks source link

Complex unit test fails with ambiguous operator+ #50

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
The current fix for 'volatile complex' does not appear to work on MSVC.

On WinXP, MSVC 2005, nvcc 3.2.
$ cd testing; scons
.
.
.
complex.cu(333) : error C2593: 'operator +' is ambiguous
        c:/documents and settings/mgarland/my documents/work/cusp-library\cusp/c
omplex.h(547): could be 'cusp::complex<float> cusp::operator +<float>(volatile c
usp::complex<float> &,volatile cusp::complex<float> &)' [found using argument-de
pendent lookup]
        c:/documents and settings/mgarland/my documents/work/cusp-library\cusp/c
omplex.h(533): or       'cusp::complex<float> cusp::operator +<float>(const cusp
::complex<float> &,const cusp::complex<float> &)' [found using argument-dependen
t lookup]
        while trying to match the argument list '(cusp::complex<float>, cusp::co
mplex<float>)'
        complex.cu(456) : see reference to function template instantiation 'cusp
::complex<float> test_complex_compilation_entry<ValueType>(void)' being compiled

        with
        [
            ValueType=float
        ]
        complex.cu(469) : see reference to function template instantiation 'void
 TestComplex<float>(void)' being compiled
complex.cu(333) : error C2593: 'operator +' is ambiguous
        c:/documents and settings/mgarland/my documents/work/cusp-library\cusp/c
omplex.h(547): could be 'cusp::complex<double> cusp::operator +<double>(volatile
 cusp::complex<double> &,volatile cusp::complex<double> &)' [found using argumen
t-dependent lookup]
        c:/documents and settings/mgarland/my documents/work/cusp-library\cusp/c
omplex.h(533): or       'cusp::complex<double> cusp::operator +<double>(const cu
sp::complex<double> &,const cusp::complex<double> &)' [found using argument-depe
ndent lookup]
        while trying to match the argument list '(cusp::complex<double>, cusp::c
omplex<double>)'
        complex.cu(456) : see reference to function template instantiation 'cusp
::complex<double> test_complex_compilation_entry<ValueType>(void)' being compile
d
        with
        [
            ValueType=double
        ]
        complex.cu(469) : see reference to function template instantiation 'void
 TestComplex<double>(void)' being compiled
scons: *** [complex.obj] Error 2
scons: building terminated because of errors.

Original issue reported on code.google.com by mjgarl...@gmail.com on 16 Nov 2010 at 4:41

GoogleCodeExporter commented 8 years ago
Unfortunately I don't have access to MSVC 2005.
Can you check if the attached file compiles?

Original comment by filipe.c...@gmail.com on 16 Nov 2010 at 7:08

Attachments:

GoogleCodeExporter commented 8 years ago
Yes, I was able to compile your test.cpp file without errors on MSVC.

Original comment by mjgarl...@gmail.com on 16 Nov 2010 at 7:27

GoogleCodeExporter commented 8 years ago
Can you please check if the attached patch fixes the problem?

Original comment by filipe.c...@gmail.com on 16 Nov 2010 at 11:51

Attachments:

GoogleCodeExporter commented 8 years ago
That seems to fix the problem.  Thanks!  I'm committing that change now.

Original comment by mjgarl...@gmail.com on 17 Nov 2010 at 2:34

GoogleCodeExporter commented 8 years ago
This issue was closed by revision d040a2b0ef.

Original comment by mjgarl...@gmail.com on 17 Nov 2010 at 2:35