This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/68831] New: [6 Regression] Superfluous -Waddress warning for C++ delete


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; }
                      ^~~~~

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]