[LLVMbugs] [Bug 13382] New: Collapse type names in diagnostics with any available using declarations

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Jul 17 14:02:07 PDT 2012


http://llvm.org/bugs/show_bug.cgi?id=13382

             Bug #: 13382
           Summary: Collapse type names in diagnostics with any available
                    using declarations
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: chandlerc at gmail.com
                CC: llvmbugs at cs.uiuc.edu, richard-llvm at metafoo.co.uk,
                    rtrieu at google.com
    Classification: Unclassified


When clang is printing types in diagnostics, we should show the types as
written, even when written against using declarations:

% cat x.cc
namespace n1 { namespace n2 { namespace n3 { namespace n4 {
  struct S {};
} } } }

using n1::n2::n3::n4::S;

template <typename T> struct identity { typedef typename T type; };
template <typename T> void f(T x, typename identity<T*>::type z);

void test(S *s) {
  f(s, s);
}

% ./bin/clang -fsyntax-only x.cc
x.cc:7:58: error: expected a qualified name after 'typename'
template <typename T> struct identity { typedef typename T type; };
                                                         ^
x.cc:11:3: error: no matching function for call to 'f'
  f(s, s);
  ^
x.cc:8:28: note: candidate function [with T = n1::n2::n3::n4::S *] not viable:
no known conversion from 'n1::n2::n3::n4::S *' to 'typename identity<S
**>::type' (aka 'n1::n2::n3::n4::S **') for 2nd argument; take the address of
the argument with &
template <typename T> void f(T x, typename identity<T*>::type z);
                           ^
2 errors generated.


Here, at the very least, we should use "[with T = S *]" and "from 'S *'" the
same way we say "identity<S **>".

I would still want "(aka 'n1::n2::n3::n4::S **')" to help catch when the wrong
using declaration was found by accident.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list