For the testcase
template<typename T> void foo(T);
void bar()
{
struct A a;
foo(a);
}
the we get the following error message since GCC 3.4.0:
bug.cc: In function 'void bar()':
bug.cc:5: error: aggregate 'A a' has incomplete type and cannot be defined
bug.cc:6: error: no matching function for call to 'foo(<type error>)'
Although not completely bogus, the last line is not very helpful here.
Since "a" has error_mark_node as type, overload resolution just won't
work. In fact we shouldn't perform overload analysis here at all IMHO.
Patch under way.
--
Summary: [3.4/4.0/4.1 regression] Bogus error message: no
matching function for call to 'foo(<type error>)'
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Keywords: diagnostic
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: reichelt at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23965