[llvm-bugs] [Bug 40849] New: Diagnostics for non-SFINAE errors triggered by deduction guides should include a line number

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Feb 24 17:35:20 PST 2019


https://bugs.llvm.org/show_bug.cgi?id=40849

            Bug ID: 40849
           Summary: Diagnostics for non-SFINAE errors triggered by
                    deduction guides should include a line number
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: arthur.j.odwyer at gmail.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
                    neeilans at live.com, richard-llvm at metafoo.co.uk

This is an example of the diagnostics that Clang produces when it encounters a
slightly buggy deduction guide. The error is quite verbose, but it critically
omits to mention WHICH "function template '<deduction guide for
unordered_set>'" it was considering when the error hit. (There are at least 8
possibilities in my code. Maybe more: I don't know if Clang might be counting
the implicitly generated candidates as "deduction guides".)
I would love it if Clang reported the source line number of the offending
'<deduction guide for unordered_set>'. I wouldn't even ask for the line to be
printed out; just having the number would be really helpful for tracking down
this bug of mine.

```
In file included from llvm/projects/libcxx/include/unordered_set:362:
In file included from llvm/projects/libcxx/include/__hash_table:15:
llvm/projects/libcxx/include/memory:1522:38: error: no type named 'value_type'
in 'std::__1::hash<short>'
    typedef typename allocator_type::value_type value_type;
            ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
llvm/projects/libcxx/include/__hash_table:893:51: note: in instantiation of
template class 'std::__1::allocator_traits<std::__1::hash<short> >' requested
here
      __make_hash_node_types<value_type, typename
__alloc_traits::void_pointer>::type
                                                  ^
llvm/projects/libcxx/include/__hash_table:1410:12: note: in instantiation of
template class 'std::__1::__hash_table<int, std::__1::hash<int>,
std::__1::equal_to<int>, std::__1::hash<short> >' requested here
    bool = __hash_table<_Tp, _Hash, _Equal,
_Alloc>::__allow_trivial_relocation::value>
           ^
llvm/projects/libcxx/include/unordered_set:400:13: note: in instantiation of
default argument for '__hash_table_relocate_base<int, std::__1::hash<int>,
std::__1::equal_to<int>, std::__1::hash<short> >' required here
    typedef __hash_table_relocate_base<value_type, hasher, key_equal,
allocator_type> __table;
           
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
llvm/projects/libcxx/test/std/containers/unord/unord.set/unord.set.cnstr/deduct.pass.cpp:143:24:
note: while substituting deduced template arguments into function template
'<deduction guide for unordered_set>' [with _Value = int, _Hash = (no value),
_Pred = (no value), _Alloc = std::__1::hash<short>]
    std::unordered_set s({ 1, 2, 1, INT_MAX, 3 }, 42, std::hash<short>());
                       ^
```

-- 
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/20190225/542a56d3/attachment.html>


More information about the llvm-bugs mailing list