This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/54165] New: Cast to "void" should not implicitly call conversion functions


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;
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]