Am 05.07.2012 10:39, schrieb Richard Smith:
> Author: rsmith
> Date: Thu Jul  5 03:39:21 2012
> New Revision: 159733
>
> URL: http://llvm.org/viewvc/llvm-project?rev=159733&view=rev
> Log:
> PR13273: When performing list-initialization with an empty initializer list,
> actually perform value initialization rather than trying to fake it with a 
> call
> to the default constructor. Fixes various bugs related to the 
> previously-missing
> zero-initialization in this case.
>
> I've also moved this and the other list initialization 'special case' from
> TryConstructorInitialization into TryListInitialization where they belong.
>
...
> +namespace explicit_default {
> +  struct A {
> +    explicit A(); // expected-note{{here}}
> +  };
> +  A a {}; // ok
> +  // This is copy-list-initialization, and we choose an explicit constructor
> +  // (even though we do so via value-initialization), so the initialization 
> is
> +  // ill-formed.
> +  A b = {}; // expected-error{{chosen constructor is explicit}}
> +}
> +

Richard, I'm pretty sure that this is valid code. A value-initialization 
doesn't respect "explicit". Are you assuming a C++ Standard defect here?

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to