[lldb-dev] Compilation failure on FreeBSD 8.

Enrico Granata granata.enrico at gmail.com
Thu Sep 22 07:29:41 PDT 2011

The reason for this error looks like an ambiguity in template resolution. In order to implement a "special" behavior for regex-based summaries, the Delete_Impl call uses template specialization:
    template<typename K, typename V>
    Delete_Impl (ConstString type, Types<K,V>)
    template<typename V>
    Delete_Impl (ConstString type, Types<lldb::RegularExpressionSP,V>)

Your compiler seems to be inferring correctly the template arguments, but has a doubt on whether it should pick the specialized function, or the general one replacing K = lldb::RegularExpressionSP

This is the first time I see a compiler being confused at this (LLDB is routinely compiled with clang and I guess several people compile it on Linux with GCC as well). This idiom is actually a quite common way to obtain one-function-specialization-inside-class-template.

In order to try and solve this, could you try to clean your LLDB build folder and try to build LLDB alone without the rest of LLVM, or using a different more recent version of GCC?

- Enrico Granata

On Sep 22, 2011, at 4:07 PM, arrowdodger wrote:

> Hello. I'm compiling trunk LLVM + trunk lldb on i386 FreeBSD 8 system (GCC 4.2.1) and see this error:
> /usr/code/llvm/tools/lldb/source/Commands/../../include/lldb/Core/FormatNavigator.h: In member function 'bool lldb_private::FormatNavigator<KeyType, ValueType>::Delete(lldb_private::ConstString) [with KeyType = lldb_private::SharingPtr<lldb_private::RegularExpression>, ValueType = lldb_private::SummaryFormat]':
> CommandObjectType.cpp:1064:   instantiated from here
> /usr/code/llvm/tools/lldb/source/Commands/../../include/lldb/Core/FormatNavigator.h:269: error: call of overloaded 'Delete_Impl(lldb_private::ConstString&, lldb_private::FormatNavigator<lldb_private::SharingPtr<lldb_private::RegularExpression>, lldb_private::SummaryFormat>::Types<lldb_private::SharingPtr<lldb_private::RegularExpression>, lldb_private::SummaryFormat>)' is ambiguous
> /usr/code/llvm/tools/lldb/source/Commands/../../include/lldb/Core/FormatNavigator.h:333: note: candidates are: bool lldb_private::FormatNavigator<KeyType, ValueType>::Delete_Impl(lldb_private::ConstString, lldb_private::FormatNavigator<KeyType, ValueType>::Types<K, V>) [with K = lldb_private::SharingPtr<lldb_private::RegularExpression>, V = lldb_private::SummaryFormat, KeyType = lldb_private::SharingPtr<lldb_private::RegularExpression>, ValueType = lldb_private::SummaryFormat]
> /usr/code/llvm/tools/lldb/source/Commands/../../include/lldb/Core/FormatNavigator.h:340: note:                 bool lldb_private::FormatNavigator<KeyType, ValueType>::Delete_Impl(lldb_private::ConstString, lldb_private::FormatNavigator<KeyType, ValueType>::Types<lldb_private::SharingPtr<lldb_private::RegularExpression>, V>) [with V = lldb_private::SummaryFormat, KeyType = lldb_private::SharingPtr<lldb_private::RegularExpression>, ValueType = lldb_private::SummaryFormat]
> _______________________________________________
> lldb-dev mailing list
> lldb-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20110922/3435da28/attachment.html>

More information about the lldb-dev mailing list