[Bug c++/68831] New: [6 Regression] Superfluous -Waddress warning for C++ delete
trippels at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Dec 10 11:03:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68831
Bug ID: 68831
Summary: [6 Regression] Superfluous -Waddress warning for C++
delete
Product: gcc
Version: 6.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: trippels at gcc dot gnu.org
CC: ppalka at gcc dot gnu.org
Target Milestone: ---
Since r224455 the compiler issues a bogus warning for the following testcase:
% cat AsmPrinter.ii
class DenseMap {
public:
~DenseMap();
};
const DenseMap &GCMap{};
void foo() { delete &GCMap; }
% g++ -std=c++14 -Waddress -c AsmPrinter.ii
AsmPrinter.ii: In function ‘void foo()’:
AsmPrinter.ii:6:22: warning: the compiler can assume that the address of
‘GCMap’ will never be NULL [-Waddress]
void foo() { delete &GCMap; }
^~~~~
More information about the Gcc-bugs
mailing list