[Bug c++/40749] New: g++ doesnt report missing return if return is of type const

2009-07-14 Thread mfribeiro at gmail dot com
This code below wont generate a warning for function a(). Compiled with -Wall.
If you remove the const from the return, it will work.


class A {
public:
};

const A a() {
}

int main() {
  A b = a();
}



-- 
   Summary: g++ doesnt report missing return if return is of type
const 
   Product: gcc
   Version: 4.3.2
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: mfribeiro at gmail dot com
 GCC build triplet: x86_64 GNU/Linux
  GCC host triplet: x86_64 GNU/Linux
GCC target triplet: x86_64 GNU/Linux


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40749



[Bug c++/48829] New: g++ no warning initializing a variable using itself

2011-04-29 Thread mfribeiro at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48829

   Summary: g++ no warning initializing a variable using itself
   Product: gcc
   Version: 4.4.3
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: mfribe...@gmail.com


This code issues a warning:

g++ -Wall
int i = 5 + i;
warning: ā€˜i’ may be used uninitialized in this function

This code does not:
string s = string("str") + s;

Neither this:
string s(string("str") + s);

Shouldnt the 2 last ones issue warnings too?