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

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Jan 1 17:57:57 PST 2016


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

            Bug ID: 25992
           Summary: Cannot call std::string::~string explicitly
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: yasserasmi at live.com
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org
    Classification: Unclassified

Test case:
#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();
}

Workarounds:
#1: Using namespace std;
#2: Calling ~basic_string() instead of ~string()

The code works on GCC without workarounds.

Compiler details:
gcc --version Configured with: --prefix=/Library/Developer/CommandLineTools/usr
--with-gxx-include-dir=/usr/include/c++/4.2.1 Apple LLVM version 7.0.2
(clang-700.1.81) Target: x86_64-apple-darwin15.2.0 Thread model: posix

More details:
http://stackoverflow.com/questions/34560903/mac-gcc-doesnt-allow-calling-stdstringstring-explicitly

-- 
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/20160102/a385e541/attachment.html>


More information about the llvm-bugs mailing list