[LLVMbugs] [Bug 10053] New: [QoI] diagnostic in case of two-stage name lookup-related errors could be better

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon May 30 15:14:56 PDT 2011


           Summary: [QoI] diagnostic in case of two-stage name
                    lookup-related errors could be better
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: richard-llvm at metafoo.co.uk
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com

A recurring problem when people try to switch from g++ to clang is errors due
to two-stage name lookup:


It would be great if we could produce awesome diagnostics for such cases, by
repeating the unqualified (non-ADL) name lookup and checking whether any
newly-found functions are viable:

  my_file.cpp:2:10: error: use of undeclared identifier 'Multiply'
    return Multiply(x, x);

  my_file.cpp:10:3: note: in instantiation of function template specialization
'Squared<int>' requested here

  my_file.cpp:5:5: note: viable function not candidate: declared after template
was defined, and not in an associated namespace
  int Multiply(int x, int y) {

Further, this new note should probably suppress the existing 'candidate
function not viable' notes, since we can be confident that this newly-declared
function is the one the user meant to call. That would trim this huge
diagnostic down to just one error and three useful notes:


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