[Bug c++/48483] Construct from yourself w/o warning

2014-11-23 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48483 Paolo Carlini paolo.carlini at oracle dot com changed: What|Removed |Added CC||lundberj

[Bug c++/48483] Construct from yourself w/o warning

2012-02-09 Thread manu at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48483 --- Comment #17 from Manuel López-Ibáñez manu at gcc dot gnu.org 2012-02-09 11:35:27 UTC --- Clang++ 3.0 warns with -Wuninitialized /tmp/webcompile/_15338_0.cc:7:5: warning: variable 'a' is uninitialized when used within its own initialization

[Bug c++/48483] Construct from yourself w/o warning

2012-02-09 Thread lisp2d at lisp2d dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48483 --- Comment #18 from Lisp2D lisp2d at lisp2d dot net 2012-02-09 16:59:19 UTC --- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48483#c2 shows that function calling of object before constructor is bad idea and must be strongly forbidden.

[Bug c++/48483] Construct from yourself w/o warning

2012-02-09 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48483 --- Comment #19 from Jonathan Wakely redi at gcc dot gnu.org 2012-02-09 17:04:06 UTC --- Everyone knows it's a bad idea, and everyone agrees there should be a warning. Stop going on about it.

[Bug c++/48483] Construct from yourself w/o warning

2012-02-09 Thread manu at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48483 --- Comment #20 from Manuel López-Ibáñez manu at gcc dot gnu.org 2012-02-09 21:37:38 UTC --- (In reply to comment #18) http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48483#c2 shows that function calling of object before constructor is bad idea

[Bug c++/48483] Construct from yourself w/o warning

2011-04-07 Thread d.g.gorbachev at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48483 --- Comment #8 from Dmitry Gorbachev d.g.gorbachev at gmail dot com 2011-04-07 06:20:24 UTC --- There is a call to a non-static member function of the object before initialization by a constructor. That's undefined behavior. Not a compiler bug.

[Bug c++/48483] Construct from yourself w/o warning

2011-04-07 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48483 Jonathan Wakely redi at gcc dot gnu.org changed: What|Removed |Added Keywords||diagnostic ---

[Bug c++/48483] Construct from yourself w/o warning

2011-04-07 Thread lisp2d at lisp2d dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48483 --- Comment #10 from Lisp2D lisp2d at lisp2d dot net 2011-04-07 13:19:16 UTC --- (In reply to comment #9) No, the variable is in scope after its identifier, so it can be used in the initializer expression, e.g. int i = sizeof(i); // ok

[Bug c++/48483] Construct from yourself w/o warning

2011-04-07 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48483 --- Comment #11 from Jonathan Wakely redi at gcc dot gnu.org 2011-04-07 13:26:16 UTC --- (In reply to comment #10) The answer of question gives the C++ standard. Show me this document. 3.3.1 Point of declaration [basic.scope.decl] 1 The point

[Bug c++/48483] Construct from yourself w/o warning

2011-04-07 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48483 --- Comment #12 from Jonathan Wakely redi at gcc dot gnu.org 2011-04-07 13:29:43 UTC --- For the example in comment 2 G++, EDG and Clang++ all accept it without warning. MSVC rejects it, but is wrong to do so.

[Bug c++/48483] Construct from yourself w/o warning

2011-04-07 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48483 --- Comment #13 from Jonathan Wakely redi at gcc dot gnu.org 2011-04-07 13:38:11 UTC --- (In reply to comment #10) (In reply to comment #9) No, the variable is in scope after its identifier, so it can be used in the initializer expression,

[Bug c++/48483] Construct from yourself w/o warning

2011-04-07 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48483 --- Comment #14 from Jonathan Wakely redi at gcc dot gnu.org 2011-04-07 13:39:45 UTC --- (In reply to comment #13) (In reply to comment #10) (In reply to comment #9) No, the variable is in scope after its identifier, so it can be used in

[Bug c++/48483] Construct from yourself w/o warning

2011-04-07 Thread lisp2d at lisp2d dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48483 --- Comment #15 from Lisp2D lisp2d at lisp2d dot net 2011-04-07 13:58:38 UTC --- (In reply to comment #12) For the example in comment 2 G++, EDG and Clang++ all accept it without warning. MSVC rejects it, but is wrong to do so. The answer is

[Bug c++/48483] Construct from yourself w/o warning

2011-04-07 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48483 Jonathan Wakely redi at gcc dot gnu.org changed: What|Removed |Added Status|UNCONFIRMED |NEW Last

[Bug c++/48483] Construct from yourself w/o warning

2011-04-06 Thread d.g.gorbachev at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48483 --- Comment #1 from Dmitry Gorbachev d.g.gorbachev at gmail dot com 2011-04-06 19:20:02 UTC --- No warnings and deep stillness. $ g++ -O -Wuninitialized pr48483.cc pr48483.cc: In function 'int main()': pr48483.cc:13:30: warning: 'a.A::b' is

[Bug c++/48483] Construct from yourself w/o warning

2011-04-06 Thread lisp2d at lisp2d dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48483 --- Comment #2 from Lisp2D lisp2d at lisp2d dot net 2011-04-06 21:15:42 UTC --- Try the next example, more close to my code: #includeiostream classA{ public: inta; A(intx):a(x){} intTheInt(){returna;} }; void

[Bug c++/48483] Construct from yourself w/o warning

2011-04-06 Thread d.g.gorbachev at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48483 Dmitry Gorbachev d.g.gorbachev at gmail dot com changed: What|Removed |Added CC|

[Bug c++/48483] Construct from yourself w/o warning

2011-04-06 Thread d.g.gorbachev at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48483 Dmitry Gorbachev d.g.gorbachev at gmail dot com changed: What|Removed |Added CC||manu at

[Bug c++/48483] Construct from yourself w/o warning

2011-04-06 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48483 --- Comment #5 from Jonathan Wakely redi at gcc dot gnu.org 2011-04-06 23:50:38 UTC --- and PR 18016 but I don't think my patch will catch this there's a limit to how much silliness the compiler can catch, at some point you have to just not

[Bug c++/48483] Construct from yourself w/o warning

2011-04-06 Thread d.g.gorbachev at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48483 --- Comment #6 from Dmitry Gorbachev d.g.gorbachev at gmail dot com 2011-04-07 01:38:53 UTC --- there's a limit to how much silliness the compiler can catch, at some point you have to just not write silly code ;) Yes, these reduced fragments

[Bug c++/48483] Construct from yourself w/o warning

2011-04-06 Thread lisp2d at lisp2d dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48483 --- Comment #7 from Lisp2D lisp2d at lisp2d dot net 2011-04-07 04:33:52 UTC --- The example http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48483#c2 shows a compiler bug. TYPE VARIABLE [ARGUMENT-TO-CONSTRUCT] The compiler must doing like this: 1.