[llvm-bugs] [Bug 25992] Cannot call std::string::~string explicitly

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Jan 7 14:23:53 PST 2016


https://llvm.org/bugs/show_bug.cgi?id=25992

David Blaikie <dblaikie at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |dblaikie at gmail.com
         Resolution|---                         |WORKSFORME

--- Comment #2 from David Blaikie <dblaikie at gmail.com> ---
Works for me: 

$ cat call.cpp
#include <new>
#include <type_traits>
#include <string>

int main() {
    std::aligned_storage<sizeof(std::string)>::type storage;

    std::string* obj = new(&storage) std::string;

    using namespace std; // Workaround #1:Without this line, clang fails.
    obj->std::string::~string();
}
blaikie at blaikie-linux:/tmp/dbginfo$
~/dev/llvm/build/clang/debug/nosplit/types/nostandalone/bin/clang++ call.cpp
-std=c++11
blaikie at blaikie-linux:/tmp/dbginfo$
~/dev/llvm/build/clang/debug/nosplit/types/nostandalone/bin/clang++ -v
clang version 3.8.0 (trunk 257092) (llvm/trunk 257094)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir:
/usr/local/google/home/blaikie/dev/llvm/build/clang/debug/nosplit/types/nostandalone/bin
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.4.7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.7.3
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9.1
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64


You should file bugs on Apple's distribution against Apple

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160107/31dc963a/attachment.html>


More information about the llvm-bugs mailing list