Committed an alternative fix for this in r198374 and included your test case in r198377. Thanks for the patch/help!<br><br>(we could make this support move-only elements too one day, but I didn't have an immediate incentive to do that)<br>
<div>On Wed Jan 01 2014 at 4:28:34 PM, Maciej Piechotka <<a href="mailto:uzytkownik2@gmail.com">uzytkownik2@gmail.com</a>> wrote:</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Added in new patch<br>
<br>
On Wed, 2014-01-01 at 19:12 +0000, <a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a> wrote:<br>
> Unit tests would be nice<br>
><br>
> On Tue Dec 31 2013 at 9:15:41 AM, Maciej Piechotka<br>
> <<a href="mailto:uzytkownik2@gmail.com" target="_blank">uzytkownik2@gmail.com</a>> wrote:<br>
>         On Tue, 2013-12-31 at 15:30 +0100, Maciej Piechotka wrote:<br>
>         > Hi,<br>
>         ><br>
>         > Sorry for double posting - it looks like I run into problems<br>
>         with my MUA<br>
>         > and I believe my previous message just disappear.<br>
>         ><br>
>         > It looks like currently it is hard to add value to<br>
>         llvm::StringMap which<br>
>         > does not have a default constructor (i.e. user needs to<br>
>         allocate<br>
>         > llvm::StringMapEntry by hand, construct it and fill it<br>
>         effectivly<br>
>         > reimplementing llvm::StringMapEntry::Create) such as<br>
>         llvm::Regex and it<br>
>         > is not possible to construct not-copy constructable value<br>
>         without<br>
>         > default constructor in C++11 by the 'hard' way.<br>
>         ><br>
>         > The attached patch allows to just copy the value when lvalue<br>
>         reference<br>
>         > is passed to llvm::StringMapEntry::Create. I thought about<br>
>         adding the<br>
>         > method for C++11:<br>
>         ><br>
>         >     template<typename... Args><br>
>         >     MapEntryTy &GetOrCreateValue(StringRef Key, Args &&...<br>
>         Val)<br>
>         ><br>
>         > But I'm not sure how it interacted with<br>
>         llvm::<u></u>StringMapEntryInitializer<br>
>         > use case (there seems to be no use of it in current llvm<br>
>         codebase except<br>
>         > test and I'm not sure what's the usecase for it).<br>
>         ><br>
>         > Best regards<br>
><br>
>         Updated patch - I wasn't aware of LLVM feature macros.<br>
>         ______________________________<u></u>_________________<br>
>         llvm-commits mailing list<br>
>         <a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a><br>
>         <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/llvm-commits</a><br>
<br>
</blockquote>