Re: PSA: Constructors callable with one argument should be marked as explicit/implicit

2014-12-22 Thread Ehsan Akhgari
On 2014-12-18 10:37 PM, Jean-Yves Avenard wrote: Hi On Friday, December 19, 2014, Ehsan Akhgari mailto:ehsan.akhg...@gmail.com>> wrote: That should be it! The plugin is transparent, unless it finds an error in which case you'll get a normal error diagnostic. That is weird then. Becau

Re: PSA: Constructors callable with one argument should be marked as explicit/implicit

2014-12-18 Thread Jean-Yves Avenard
Hi On Friday, December 19, 2014, Ehsan Akhgari wrote: > That should be it! The plugin is transparent, unless it finds an error in > which case you'll get a normal error diagnostic. > > That is weird then. Because I have a patch that fails the Linux64 static analysis test. But I can't reproduce

Re: PSA: Constructors callable with one argument should be marked as explicit/implicit

2014-12-18 Thread Ehsan Akhgari
On 2014-12-18 9:12 AM, jyaven...@gmail.com wrote: On Thursday, December 18, 2014 1:08:23 PM UTC+11, Ehsan Akhgari wrote: That being said, if someone wants to add a mach command for this, please go ahead by all means. I definitely have no objection. is there documentation somewhere on how to

Re: PSA: Constructors callable with one argument should be marked as explicit/implicit

2014-12-18 Thread jyavenard
On Thursday, December 18, 2014 1:08:23 PM UTC+11, Ehsan Akhgari wrote: > That being said, if someone wants to add a mach command for this, please > go ahead by all means. I definitely have no objection. is there documentation somewhere on how to run the clang-plugin ? I've installed clang-3.6

Re: PSA: Constructors callable with one argument should be marked as explicit/implicit

2014-12-17 Thread Ehsan Akhgari
On 2014-12-17 1:11 PM, Gregory Szorc wrote: On 12/17/14 9:32 AM, Ehsan Akhgari wrote: On 2014-12-17 11:40 AM, Ted Mielczarek wrote: On 12/17/2014 10:19 AM, Ehsan Akhgari wrote: Apple unfortunately doesn't ship the headers and libraries required to build against that clang, and if you try to c

Re: PSA: Constructors callable with one argument should be marked as explicit/implicit

2014-12-17 Thread Gregory Szorc
On 12/17/14 9:32 AM, Ehsan Akhgari wrote: On 2014-12-17 11:40 AM, Ted Mielczarek wrote: On 12/17/2014 10:19 AM, Ehsan Akhgari wrote: Apple unfortunately doesn't ship the headers and libraries required to build against that clang, and if you try to compile the plugin against headers/libraries o

Re: PSA: Constructors callable with one argument should be marked as explicit/implicit

2014-12-17 Thread Ehsan Akhgari
On 2014-12-17 11:40 AM, Ted Mielczarek wrote: On 12/17/2014 10:19 AM, Ehsan Akhgari wrote: Apple unfortunately doesn't ship the headers and libraries required to build against that clang, and if you try to compile the plugin against headers/libraries obtained from elsewhere there is a good chan

Re: PSA: Constructors callable with one argument should be marked as explicit/implicit

2014-12-17 Thread Ted Mielczarek
On 12/17/2014 10:19 AM, Ehsan Akhgari wrote: > > Apple unfortunately doesn't ship the headers and libraries required to > build against that clang, and if you try to compile the plugin against > headers/libraries obtained from elsewhere there is a good chance that > the plugin won't work, so your b

Re: PSA: Constructors callable with one argument should be marked as explicit/implicit

2014-12-17 Thread Ehsan Akhgari
On 2014-12-15 9:02 PM, Anthony Jones wrote: On 15/12/14 12:28, Ehsan Akhgari wrote: In order to avoid burning the tree, if you are a clang user you can add ac_add_options --enable-clang-plugin to your mozconfig and make sure you are using a recent version of clang with the development headers an

Re: PSA: Constructors callable with one argument should be marked as explicit/implicit

2014-12-17 Thread Ehsan Akhgari
On 2014-12-15 10:08 PM, Bobby Holley wrote: On Sun, Dec 14, 2014 at 3:28 PM, Ehsan Akhgari mailto:ehsan.akhg...@gmail.com>> wrote: In order to avoid burning the tree, if you are a clang user you can add ac_add_options --enable-clang-plugin to your mozconfig and make sure you are usin

Re: PSA: Constructors callable with one argument should be marked as explicit/implicit

2014-12-15 Thread Bobby Holley
On Sun, Dec 14, 2014 at 3:28 PM, Ehsan Akhgari wrote: > In order to avoid burning the tree, if you are a clang user you can add > ac_add_options --enable-clang-plugin to your mozconfig and make sure you > are using a recent version of clang with the development headers and > libraries installed (

Re: PSA: Constructors callable with one argument should be marked as explicit/implicit

2014-12-15 Thread Anthony Jones
On 15/12/14 12:28, Ehsan Akhgari wrote: > In order to avoid burning the tree, if you are a clang user you can add > ac_add_options --enable-clang-plugin to your mozconfig and make sure you > are using a recent version of clang with the development headers and > libraries installed (the binary packa

Re: PSA: Constructors callable with one argument should be marked as explicit/implicit

2014-12-14 Thread David Rajchenbach-Teller
On 15/12/14 00:28, Ehsan Akhgari wrote: > Hi all, > > In C++, if a constructor can be invoked with one argument (that is if it > has 1 required and N>=0 optional arguments, or N>0 optional arguments), > it provides an implicit conversion from the type of the first argument > to the class's type.

PSA: Constructors callable with one argument should be marked as explicit/implicit

2014-12-14 Thread Ehsan Akhgari
Hi all, In C++, if a constructor can be invoked with one argument (that is if it has 1 required and N>=0 optional arguments, or N>0 optional arguments), it provides an implicit conversion from the type of the first argument to the class's type. This can sometimes produce surprising results, f