[LLVMbugs] [Bug 24127] New: Cannot take pointer to std::string::append(const std::string&) method
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Tue Jul 14 17:46:27 PDT 2015
https://llvm.org/bugs/show_bug.cgi?id=24127
Bug ID: 24127
Summary: Cannot take pointer to std::string::append(const
std::string&) method
Product: libc++
Version: 3.6
Hardware: PC
OS: FreeBSD
Status: NEW
Severity: normal
Priority: P
Component: All Bugs
Assignee: unassignedclangbugs at nondot.org
Reporter: amdmi3 at amdmi3.ru
CC: dimitry at andric.com, llvmbugs at cs.uiuc.edu,
mclow.lists at gmail.com
Classification: Unclassified
Trying to get pointer to std::string::append(const std::string&) method:
---
#include <string>
int main() {
typedef std::string& (std::string::* StringMethod)(const std::string&);
StringMethod append = &std::string::append;
return 0;
}
---
clang++/libc++ 3.4 (FreeBSD 10.1) as well as gcc 4.8, 4.9, 5.0 compile this
fine. However with clang++/libc++ 3.6.1 (FreeBSD CURRENT r284196) I get the
following:
---
/tmp/1-efeea7.o: In function `main':
1.cc:(.text+0x19): undefined reference to `std::__1::basic_string<char,
std::__1::char_traits<char>, std::__1::allocator<char>
>::append(std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> > const&)'
c++: error: linker command failed with exit code 1 (use -v to see invocation)
---
with -v:
---
FreeBSD clang version 3.6.1 (tags/RELEASE_361/final 237755) 20150525
Target: x86_64-unknown-freebsd11.0
Thread model: posix
"/usr/bin/c++" -cc1 -triple x86_64-unknown-freebsd11.0 -emit-obj -mrelax-all
-disable-free -main-file-name 1.cc -mrelocation-model static -mthread-model
posix -mdisable-fp-elim -masm-verbose -mconstructor-aliases -munwind-tables
-target-cpu x86-64 -v -dwarf-column-info -resource-dir
/usr/bin/../lib/clang/3.6.1 -internal-isystem /usr/include/c++/v1
-fdeprecated-macro -fdebug-compilation-dir /tmp -ferror-limit 19
-fmessage-length 233 -mstackrealign -fobjc-runtime=gnustep -fcxx-exceptions
-fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o /tmp/1-61a9cc.o
-x c++ 1.cc
clang -cc1 version 3.6.1 based upon LLVM 3.6.1 default target
x86_64-unknown-freebsd11.0
#include "..." search starts here:
#include <...> search starts here:
/usr/include/c++/v1
/usr/bin/../lib/clang/3.6.1/include
/usr/include
End of search list.
"/usr/bin/ld" --eh-frame-hdr -dynamic-linker /libexec/ld-elf.so.1
--hash-style=both --enable-new-dtags -o a.out /usr/lib/crt1.o /usr/lib/crti.o
/usr/lib/crtbegin.o -L/usr/lib /tmp/1-61a9cc.o -lc++ -lm -lgcc --as-needed
-lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed
/usr/lib/crtend.o /usr/lib/crtn.o
/tmp/1-61a9cc.o: In function `main':
1.cc:(.text+0x19): undefined reference to `std::__1::basic_string<char,
std::__1::char_traits<char>, std::__1::allocator<char>
>::append(std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> > const&)'
c++: error: linker command failed with exit code 1 (use -v to see invocation)
---
A real life case this was encountered in:
https://github.com/npge/npge/blob/a1d174cf947f613b8edd974219817ddfa8502b1f/src/model/Sequence.cpp#L383
--
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/20150715/b8bac81c/attachment.html>
More information about the llvm-bugs
mailing list