Opened 9 years ago

Closed 5 years ago

#47191 closed defect (fixed)

clang-3.7: c++14: missing support for binary operator delete

Reported by: akimd (Akim Demaille) Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 2.3.3
Keywords: C++14 Cc: jeremyhu (Jeremy Huddleston Sequoia), larryv (Lawrence Velázquez)
Port: clang-3.7

Description

Hi all,

C++14 changed the operator delete that the keyword delete should invoke from unary to binary. Currently, this operator appears to be missing. FWIW, it seems to work properly with G++, even though it appears to call the right operator delete. So I guess it means that libstdc++ is updated, but not libc++.

$ cat foo.cc
int main()
{
  auto f = new int;
  delete f;
}
$ clang++-mp-3.6 -std=c++14  foo.cc
$ clang++-mp-3.7 -std=c++14  foo.cc
Undefined symbols for architecture x86_64:
  "operator delete(void*, unsigned long)", referenced from:
      _main in foo-7bc325.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
$ g++-mp-5 -std=c++14  foo.cc
$ g++-mp-5 -std=c++14  foo.cc -c
$ nm foo.o| c++filt | less
0000000000000030 short EH_frame1
                 U operator delete(void*, unsigned long)
                 U operator new(unsigned long)
0000000000000000 T _main

Change History (3)

comment:1 Changed 9 years ago by jeremyhu (Jeremy Huddleston Sequoia)

I don't think it's an issue with the C++ runtime library because the same runtime is used in both the 3.6 and 3.7 cases, and in the 3.6 case, a symbol dump shows that it is implementing the operator delete(void*, unsigned long) operator locally (__ZdlPvm).

I'm going to bump to current svn trunk and try to reproduce. If it's still an issue, I'll file an upstream bug to track the fix.

Last edited 9 years ago by jeremyhu (Jeremy Huddleston Sequoia) (previous) (diff)

comment:2 Changed 9 years ago by jeremyhu (Jeremy Huddleston Sequoia)

comment:3 Changed 5 years ago by kencu (Ken)

Resolution: fixed
Status: newclosed

the upstream bug is marked as "resolved-fixed"

Note: See TracTickets for help on using tickets.