<html>
<head>
<base href="https://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW " title="NEW --- - Cannot take pointer to std::string::append(const std::string&) method" href="https://urldefense.proofpoint.com/v2/url?u=https-3A__llvm.org_bugs_show-5Fbug.cgi-3Fid-3D24127&d=AwMBaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=pF93YEPyB-J_PERP4DUZOJDzFVX5ZQ57vQk33wu0vio&m=UpliiYDZaIUyyKWW9hIC8bxSsrIhs4nmgAlp_aTPxck&s=xNy9U0idBgybrjSRI8gRIjGgKNel-JQDuOT_JeChB90&e=">24127</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Cannot take pointer to std::string::append(const std::string&) method
</td>
</tr>
<tr>
<th>Product</th>
<td>libc++
</td>
</tr>
<tr>
<th>Version</th>
<td>3.6
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>FreeBSD
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>All Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>amdmi3@amdmi3.ru
</td>
</tr>
<tr>
<th>CC</th>
<td>dimitry@andric.com, llvmbugs@cs.uiuc.edu, mclow.lists@gmail.com
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>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>
<span class="quote">>::append(std::__1::basic_string<char, std::__1::char_traits<char>,</span >
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>
<span class="quote">>::append(std::__1::basic_string<char, std::__1::char_traits<char>,</span >
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:
<a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_npge_npge_blob_a1d174cf947f613b8edd974219817ddfa8502b1f_src_model_Sequence.cpp-23L383&d=AwMBaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=pF93YEPyB-J_PERP4DUZOJDzFVX5ZQ57vQk33wu0vio&m=UpliiYDZaIUyyKWW9hIC8bxSsrIhs4nmgAlp_aTPxck&s=LXQmenf0Qew2a-4a1b14Vp9W7-mzwvhb9LTyqBsV_pM&e=">https://github.com/npge/npge/blob/a1d174cf947f613b8edd974219817ddfa8502b1f/src/model/Sequence.cpp#L383</a></pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>