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: unassignedclangb...@nondot.org
          Reporter: yassera...@live.com
                CC: dgre...@apple.com, llvm-bugs@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to