This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/77474] New: sizeof and function template don't work properly together
- From: "michele.caini at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 04 Sep 2016 18:10:41 +0000
- Subject: [Bug c++/77474] New: sizeof and function template don't work properly together
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77474
Bug ID: 77474
Summary: sizeof and function template don't work properly
together
Product: gcc
Version: 6.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: michele.caini at gmail dot com
Target Milestone: ---
The following code compiles:
void f() { }
int main() {
sizeof(&f);
}
The following does not instead:
template<typename T>
void f() { }
int main() {
sizeof(&f<int>);
}
The error returned is:
error: address of overloaded function with no contextual type information
According to expr.sizeof, both of them should compile.