http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51553
Bug #: 51553 Summary: brace initialization and conversion operators Classification: Unclassified Product: gcc Version: 4.7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassig...@gcc.gnu.org ReportedBy: d...@boostpro.com Please consider this test case: --------- <schnipp> -------- struct X { X(); }; struct Y { operator X() const; }; struct Z { explicit operator X() const; }; X a = { Y() }; // #1. error: could not convert '{Y()}' from '<brace-enclosed initializer list>' to 'X' X aa = Y(); // #1a. OK X b{ Y() }; // #2. error: no matching function for call to 'X::X(<brace-enclosed initializer list>)' X bb(Y()); // #2a. OK X c = { Z() }; // #3 error: could not convert '{Z()}' from '<brace-enclosed initializer list>' to 'X' X cc = Z(); // #3a. error: conversion from 'Z' to non-scalar type 'X' requested X d{ Z() }; // #4 error: no matching function for call to 'X::X(<brace-enclosed initializer list>)' X dd( Z() ); // OK --------- <schnapp> -------- I can't find anything in the standard that justifies a difference between the brace- and braceless-initialization cases. Even in case #3, the difference in error message leads me to think the code may be failing for the wrong reasons.