https://bugzilla.novell.com/show_bug.cgi?id=718633 https://bugzilla.novell.com/show_bug.cgi?id=718633#c0 Summary: g++ sometimes treats a reference to a non-overloaded template function as overloaded Classification: openSUSE Product: openSUSE 11.4 Version: Final Platform: Other OS/Version: Other Status: NEW Severity: Major Priority: P5 - None Component: Documentation AssignedTo: ke@suse.com ReportedBy: giecrilj@stegny.2a.pl QAContact: ke@suse.com Found By: --- Blocker: --- User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:6.0.2) Gecko/20100101 Firefox/6.0.2 The function foo < void > below is unambiguously defined; however, GNU C++ requires an information about its type in order to evaluate a reference to it. Reproducible: Always Steps to Reproduce: 1. { cat <<'/* EOF */' >overloaded.cpp && g++ overloaded.cpp; } template < class T > void foo () { } void bar () {} void (*good ()) () { return bar; return foo < void >; } int bad () { return !bar; return !foo < void >; } /* EOF */ Actual Results: 1. overloaded.cpp: In function ‘int bad()’: overloaded.cpp:9:9: error: cannot resolve overloaded function ‘foo’ based on conversion to type ‘bool’ overloaded.cpp:9:9: error: in argument to unary ! Expected Results: 1. link error: undefined reference to symbol 'main' Thank you for testing your code with Comeau C/C++! Tell others about http://www.comeaucomputing.com/tryitout ! Your Comeau C/C++ test results are as follows: Comeau C/C++ 4.3.10.1 (Oct 6 2008 11:28:09) for ONLINE_EVALUATION_BETA2 Copyright 1988-2008 Comeau Computing. All rights reserved. MODE:strict errors C++ C++0x_extensions "ComeauTest.c", line 5: warning: statement is unreachable return foo < void >; ^ "ComeauTest.c", line 8: warning: controlling expression is constant return !bar; ^ "ComeauTest.c", line 9: warning: statement is unreachable return !foo < void >; ^ "ComeauTest.c", line 9: warning: controlling expression is constant return !foo < void >; ^ In strict mode, with -tused, Compile succeeded (but remember, the Comeau online compiler does not link). -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.