This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/54165] New: Cast to "void" should not implicitly call conversion functions
- From: "schaub.johannes at googlemail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 03 Aug 2012 10:59:28 +0000
- Subject: [Bug c++/54165] New: Cast to "void" should not implicitly call conversion functions
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54165
Bug #: 54165
Summary: Cast to "void" should not implicitly call conversion
functions
Classification: Unclassified
Product: gcc
Version: 4.7.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: schaub.johannes@googlemail.com
GCC should not print "what!?" in the following code, according to the C++ spec
#include <iostream>
struct A {
template<typename T>
operator T() {
std::cout << "what!?";
}
};
int main() {
A a;
(void)a;
}