[llvm-bugs] [Bug 40161] New: custom allocator and __pad_and_output from v1/locale

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Dec 26 08:50:09 PST 2018


            Bug ID: 40161
           Summary: custom allocator and __pad_and_output from v1/locale
           Product: libc++
           Version: 6.0
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: moko at design.ru
                CC: llvm-bugs at lists.llvm.org, mclow.lists at gmail.com

In our code we are using basic_stringstream with custom allocator:

typedef std::basic_stringstream<char, std::char_traits<char>,
gc_allocator<char> > pa_stringstream;
typedef std::basic_string<char, std::char_traits<char>, gc_allocator<char> >

And we have checks for default new operator usage in our code:

void *new_disabled();
inline void *operator new[] (std::size_t){ return new_disabled(); }
inline void *operator new(std::size_t){ return new_disabled(); }

And with FreeBSD clang version 6.0.0 we get the following linker error:

undefined reference to `new_disabled()'

The issue is related to the following commit:
Where the declaration is without allocator: basic_string<_CharT, _Traits>
__sp(__ns, __fl);
And if we simply comment out "if (__ns > 0)" fragment, the code compiles fine.

Note: there were not link error with previous clang (FreeBSD clang version
3.8.0), where the "locale" code is the same.
But may be the whole method was optimized out then.

If required, our full source code is available at

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/20181226/c574ece1/attachment.html>

More information about the llvm-bugs mailing list