------- Comment #1 from redi at gcc dot gnu dot org 2009-12-23 10:30 ------- The code should not compile, Visual Studio is wrong.
Base b = 5; is a copy initialization, equivalent to Base b = Base(5); which requires a copy constructor, but your copy constructor takes a non-const Base& and so cannot bind to the temporary. This is covered by 8.5 [dcl.init] paragraph 14 in the standard. -- redi at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED GCC build triplet|What is this? | GCC host triplet|Not sure what this means; | |here is the result of uname | |-a: Linux | GCC target triplet|What is this? | Resolution| |INVALID http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42470