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++/46224] Enhancement: Issue warning when matching placement delete operator is missing


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=46224

Eric Gallager <egallager at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |egallager at gcc dot gnu.org

--- Comment #2 from Eric Gallager <egallager at gcc dot gnu.org> ---
I get the following warnings for the 1st testcase:

$ /usr/local/bin/g++ -c -Wall -Wextra -pedantic -Weffc++ -Wplacement-new=2
46224.cc
46224.cc:12:13: warning: dynamic exception specifications are deprecated in
C++11 [-Wdeprecated]
        int) throw (std::bad_alloc)
             ^~~~~
46224.cc: In function ‘int main()’:
46224.cc:32:10: warning: variable ‘f’ set but not used
[-Wunused-but-set-variable]
     Foo* f;
          ^
$

And similarly for the 2nd testcase:

$ /usr/local/bin/g++ -c -Wall -Wextra -pedantic -Weffc++ -Wplacement-new=2
46224_a.cc
46224_a.cc:4:58: warning: dynamic exception specifications are deprecated in
C++11 [-Wdeprecated]
 void* operator new( std::size_t num_bytes, const char* ) throw
(std::bad_alloc);
                                                          ^~~~~
46224_a.cc: In function ‘void f()’:
46224_a.cc:13:10: warning: unused variable ‘p’ [-Wunused-variable]
     Foo* p = new(__FILE__) Foo();
          ^
$

I don't think the -Wdeprecated warnings are really the same as what this bug
requests though? I dunno. Leaving UNCONFIRMED for now.

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