compilation of the attached c++ source file foo.cpp does not work with g++-4.5.0 but it worked with g++-4.3.3. I have attached the c++ source foo.cpp and the preprocessed file foo.ii) > g++ -c foo.ii foo.cpp: In member function 'void Eval<T>::eval(mpl_::int_<0>) [with int V = 0, T = Mtrl]': foo.cpp:37:9: instantiated from 'void Eval<T>::eval() [with int V = 0, T = Mtrl]' foo.cpp:60:20: instantiated from here foo.cpp:52:9: error: call of overloaded 'value(Eval<Mtrl>::Wrap<Quan<0> >)' is ambiguous foo.cpp:44:10: note: candidates are: void Eval<T>::value(Eval<T>::Wrap<Quan<V2> >) [with int V = 0, int V2 = 0, T = Mtrl] foo.cpp:47:10: note: void Eval<T>::value(Eval<T>::Wrap<Quan<0> >) [with int V = 0, T = Mtrl]
Created attachment 19678 [details] c++ source
Created attachment 19679 [details] preprocessed cpp file of foo.cpp
> uname -a Linux yoda.intec.dom 2.6.18-164.11.1.el5 #1 SMP Wed Jan 20 07:32:21 EST 2010 x86_64 x86_64 x86_64 GNU/Linux > rpm -qa "glibc*" | grep -e 'glibc-[0-9]' | sort -u glibc-2.5-42.el5_4.3 > g++ -v Using built-in specs. COLLECT_GCC=g++ COLLECT_LTO_WRAPPER=/opt/gcc/4.5.0-20100121-svn156151/x86_64/libexec/gcc/x86_64-unknown-linux-gnu/4.5.0/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: ./configure --with-cloog=/opt/gcc/svn/aux --with-gmp=/opt/gcc/svn/aux --with-mpc=/opt/gcc/svn/aux --with-mpfr=/opt/gcc/svn/aux --with-ppl=/opt/gcc/svn/aux --disable-nls --enable-languages=c,c++,fortran --prefix=/opt/gcc/4.5.0-20100121-svn156151/x86_64 Thread model: posix gcc version 4.5.0 20100121 (experimental) (GCC) > ld -v GNU ld (GNU Binutils) 2.20.51.20100121
Could you please try to reduce the testcase? Tools like Delta often allow to rather quickly achieve good results: http://gcc.gnu.org/wiki/A_guide_to_testcase_reduction
Hi Paolo, thanks for the hint about the delta tool. I attached the file as foo.delta.ii > g++ -c foo.delta.ii foo.delta.ii: In member function 'void Eval<T>::eval(mpl_::int_<0>) [with int V = 0, T = Mtrl]': foo.delta.ii:120:115: instantiated from 'void Eval<T>::eval() [with int V = 0, T = Mtrl]' foo.delta.ii:121:110: instantiated from here foo.delta.ii:120:449: error: call of overloaded 'value(Eval<Mtrl>::Wrap<Quan<0> >)' is ambiguous foo.delta.ii:120:245: note: candidates are: void Eval<T>::value(Eval<T>::Wrap<Quan<V2> >) [with int V = 0, int V2 = 0, T = Mtrl] foo.delta.ii:120:300: note: void Eval<T>::value(Eval<T>::Wrap<Quan<0> >) [with int V = 0, T = Mtrl]
Created attachment 19688 [details] preprocessed cpp file of foo.cpp mangled by delta
Is Boost.MPL needed? I haven't tried, but it looks like you could remove mpl entirely as it isn't directly involved where the error occurs. That would make the testcase MUCH smaller
Hi Jonathan, thanks for the hint! I attached a version (goo.cpp) without boost. > g++ -c goo.cpp goo.cpp: In member function 'void Eval<T>::eval(int_<0>) [with int V = 0, T = Mtrl]': goo.cpp:42:9: instantiated from 'void Eval<T>::eval() [with int V = 0, T = Mtrl]' goo.cpp:65:20: instantiated from here goo.cpp:57:9: error: call of overloaded 'value(Eval<Mtrl>::Wrap<Quan<0> >)' is ambiguous goo.cpp:49:10: note: candidates are: void Eval<T>::value(Eval<T>::Wrap<Quan<V2> >) [with int V = 0, int V2 = 0, T = Mtrl] goo.cpp:52:10: note: void Eval<T>::value(Eval<T>::Wrap<Quan<0> >) [with int V = 0, T = Mtrl]
Created attachment 19702 [details] new c++ source file (independent of boost)
This works with gcc 4.3 and 4.4 I don't have mainline lying around here but if it really fails there it would be a 4.5 regression which should get it P1 status. Can someone try? W.
Confirmed pr42824.cc: In member function ‘void Eval<T>::eval(int_<0>) [with int V = 0, T = Mtrl]’: pr42824.cc:42:9: instantiated from ‘void Eval<T>::eval() [with int V = 0, T = Mtrl]’ pr42824.cc:65:20: instantiated from here pr42824.cc:57:9: error: call of overloaded ‘value(Eval<Mtrl>::Wrap<Quan<0> >)’ is ambiguous pr42824.cc:49:10: note: candidates are: void Eval<T>::value(Eval<T>::Wrap<Quan<V2> >) [with int V = 0, int V2 = 0, T = Mtrl] pr42824.cc:52:10: note: void Eval<T>::value(Eval<T>::Wrap<Quan<0> >) [with int V = 0, T = Mtrl]
CC'ing a release manager
A candidate patch was proposed at http://gcc.gnu.org/ml/gcc-patches/2010-01/msg01545.html
Subject: Bug 42824 Author: dodji Date: Sun Feb 21 18:06:39 2010 New Revision: 156939 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=156939 Log: Fix PR c++/42824 gcc/cp/ChangeLog: PR c++/42824 * pt.c (lookup_template_class): Better support of specialization of member of class template implicit instantiation. gcc/testsuite/ChangeLog: PR c++/42824 * g++.dg/template/memclass4.C: New test. Added: trunk/gcc/testsuite/g++.dg/template/memclass4.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/pt.c trunk/gcc/testsuite/ChangeLog
Fixed in 4.5 (trunk)
Subject: Bug 42824 Author: hjl Date: Tue Feb 23 17:02:26 2010 New Revision: 157010 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=157010 Log: Backport testcases from mainline. 2010-02-23 H.J. Lu <hongjiu.lu@intel.com> Backport from mainline: 2010-02-22 Richard Guenther <rguenther@suse.de> PR tree-optimization/42749 * gcc.c-torture/compile/pr42749.c: New testcase. 2010-02-21 Dodji Seketeli <dodji@redhat.com> PR c++/42824 * g++.dg/template/memclass4.C: New test. 2010-02-20 Paul Thomas <pault@gcc.gnu.org> PR fortran/43111 * gfortran.dg/internal_pack_8.f90: New test. 2010-02-18 Jason Merrill <jason@redhat.com> PR c++/43109 * g++.dg/parse/namespace12.C: New. 2010-02-18 Martin Jambor <mjambor@suse.cz> PR tree-optimization/43066 * gcc.c-torture/compile/pr43066.c: New test. 2010-02-17 Jason Merrill <jason@redhat.com> PR c++/43069 * g++.dg/parse/namespace11.C: New. PR c++/43093 * g++.dg/ext/attrib37.C: New. PR c++/43079 * g++.dg/template/ptrmem20.C: New. 2010-02-16 Jason Merrill <jason@redhat.com> PR c++/43031 * g++.dg/ext/attrib36.C: New. 2010-02-15 Richard Guenther <rguenther@suse.de> PR middle-end/43068 * g++.dg/torture/pr43068.C: New testcase. 2010-02-11 Richard Guenther <rguenther@suse.de> PR tree-optimization/42998 * gcc.c-torture/compile/pr42998.c: New testcase. 2010-02-10 Richard Guenther <rguenther@suse.de> PR tree-optimization/43017 * gcc.dg/torture/pr43017.c: New testcase. 2010-02-10 Richard Guenther <rguenther@suse.de> PR c/43007 * gcc.c-torture/execute/20100209-1.c: New testcase. * gcc.dg/fold-div-3.c: Likewise. 2010-02-09 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/42999 * gfortran.dg/array_constructor_35.f90: New test. 2010-02-09 Richard Guenther <rguenther@suse.de> PR tree-optimization/43008 * gcc.c-torture/execute/pr43008.c: New testcase. 2010-02-09 Richard Guenther <rguenther@suse.de> PR tree-optimization/43000 * gcc.dg/torture/pr43000.c: New testcase. * gcc.dg/torture/pr43002.c: Likewise. 2010-02-06 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libfortran/42742 * gfortran.dg/fmt_cache_2.f: New test. 2010-02-03 Jason Merrill <jason@redhat.com> PR c++/42870 * g++.dg/ext/dllexport3.C: New. Added: branches/gcc-4_4-branch/gcc/testsuite/g++.dg/ext/attrib36.C - copied unchanged from r157009, trunk/gcc/testsuite/g++.dg/ext/attrib36.C branches/gcc-4_4-branch/gcc/testsuite/g++.dg/ext/attrib37.C - copied unchanged from r157009, trunk/gcc/testsuite/g++.dg/ext/attrib37.C branches/gcc-4_4-branch/gcc/testsuite/g++.dg/ext/dllexport3.C - copied unchanged from r157009, trunk/gcc/testsuite/g++.dg/ext/dllexport3.C branches/gcc-4_4-branch/gcc/testsuite/g++.dg/parse/namespace11.C - copied unchanged from r157009, trunk/gcc/testsuite/g++.dg/parse/namespace11.C branches/gcc-4_4-branch/gcc/testsuite/g++.dg/parse/namespace12.C - copied unchanged from r157009, trunk/gcc/testsuite/g++.dg/parse/namespace12.C branches/gcc-4_4-branch/gcc/testsuite/g++.dg/template/memclass4.C - copied unchanged from r157009, trunk/gcc/testsuite/g++.dg/template/memclass4.C branches/gcc-4_4-branch/gcc/testsuite/g++.dg/template/ptrmem20.C - copied unchanged from r157009, trunk/gcc/testsuite/g++.dg/template/ptrmem20.C branches/gcc-4_4-branch/gcc/testsuite/g++.dg/torture/pr43068.C - copied unchanged from r157009, trunk/gcc/testsuite/g++.dg/torture/pr43068.C branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/compile/pr42749.c - copied unchanged from r157009, trunk/gcc/testsuite/gcc.c-torture/compile/pr42749.c branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/compile/pr42998.c - copied unchanged from r157009, trunk/gcc/testsuite/gcc.c-torture/compile/pr42998.c branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/compile/pr43066.c - copied unchanged from r157009, trunk/gcc/testsuite/gcc.c-torture/compile/pr43066.c branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/execute/20100209-1.c - copied unchanged from r157009, trunk/gcc/testsuite/gcc.c-torture/execute/20100209-1.c branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/execute/pr43008.c - copied unchanged from r157009, trunk/gcc/testsuite/gcc.c-torture/execute/pr43008.c branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/fold-div-3.c - copied unchanged from r157009, trunk/gcc/testsuite/gcc.dg/fold-div-3.c branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/torture/pr43000.c - copied unchanged from r157009, trunk/gcc/testsuite/gcc.dg/torture/pr43000.c branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/torture/pr43002.c - copied unchanged from r157009, trunk/gcc/testsuite/gcc.dg/torture/pr43002.c branches/gcc-4_4-branch/gcc/testsuite/gfortran.dg/array_constructor_35.f90 - copied unchanged from r157009, trunk/gcc/testsuite/gfortran.dg/array_constructor_35.f90 branches/gcc-4_4-branch/gcc/testsuite/gfortran.dg/fmt_cache_2.f - copied unchanged from r157009, trunk/gcc/testsuite/gfortran.dg/fmt_cache_2.f branches/gcc-4_4-branch/gcc/testsuite/gfortran.dg/internal_pack_8.f90 - copied unchanged from r157009, trunk/gcc/testsuite/gfortran.dg/internal_pack_8.f90 Modified: branches/gcc-4_4-branch/gcc/testsuite/ChangeLog