Bug 40336 - Language linkage should be part of the function type
Summary: Language linkage should be part of the function type
Status: RESOLVED DUPLICATE of bug 2316
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.4.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
Depends on:
Reported: 2009-06-04 14:15 UTC by Johannes Schaub
Modified: 2009-06-04 14:36 UTC (History)
14 users (show)

See Also:
Host: i686-pc-linux-gnu
Target: i686-pc-linux-gnu
Known to work:
Known to fail:
Last reconfirmed:


Note You need to log in before you can comment on or make changes to this bug.
Description Johannes Schaub 2009-06-04 14:15:19 UTC
Hello all, i discovered that the following code doesn't compile, why i expected that it compiles fine

template<typename, typename> struct F { typedef int type; };
template<typename A> struct F<A, A> { };

typedef void(*fp0)();
extern "C" typedef void (*fp1)();

int main() { F<fp0, fp1>::type i; }

// diagnostic:
main.cpp: In function 'int main()':
main.cpp:7: error: 'type' is not a member of 'F<void (*)(), void (*)()>'
main.cpp:7: error: expected ';' before 'i'

The problem seems to be that it thinks the function pointer types are the same - but C++ is very clear on that they are different types.
Comment 1 Andrew Pinski 2009-06-04 14:36:33 UTC

*** This bug has been marked as a duplicate of 2316 ***