[LLVMbugs] [Bug 19454] New: missing 'did you mean to deference' diagnostic

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Apr 16 14:36:26 PDT 2014


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

            Bug ID: 19454
           Summary: missing 'did you mean to deference' diagnostic
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: richard-llvm at metafoo.co.uk
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu,
                    rtrieu at google.com
    Classification: Unclassified

Not sure why I didn't get the "dereference the argument with *" diagnostic
here:

lib/Parse/ParseDeclCXX.cpp:1546:11: error: non-const lvalue reference to type
'clang::TemplateIdAnnotation' cannot bind to a value of unrelated type
'clang::TemplateIdAnnotation *'
          TemplateId, attrs.getList(),
          ^~~~~~~~~~
include/clang/Sema/Sema.h:5282:58: note: passing argument to parameter
'TemplateId' here
                                   TemplateIdAnnotation &TemplateId,
                                                         ^

Reduced testcase:

  struct S { void f(int &); } s;
  void g(int *p) { s.f(p); }

<stdin>:2:24: error: non-const lvalue reference to type 'int' cannot bind to a
value of unrelated type 'int *'
  void g(int *p) { s.f(p); }
                       ^
<stdin>:1:26: note: passing argument to parameter here
  struct S { void f(int &); } s;
                         ^

I'd expect the problem here is that we skip overload resolution, and so we
don't get its brand of diagnostic improvements.

-- 
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/20140416/a3ca554c/attachment.html>


More information about the llvm-bugs mailing list