[LLVMbugs] [Bug 7209] New: Seek out invalid candidates that GCC would find when overload resolution fails

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun May 23 08:59:11 PDT 2010


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

           Summary: Seek out invalid candidates that GCC would find when
                    overload resolution fails
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Keywords: quality-of-implementation
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: dgregor at apple.com
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


GCC compiles the following example because it performs non-ADL name lookup for
operator<< at instantiation time (which is wrong):

  #include <iostream>

  namespace N {
    struct X { };
  }
  using namespace N;

  template<typename T>
  void log(const T& t) {
    std::clog << t;
  } 

  std::ostream &operator<<(std::ostream&, const X& x);

  template void log(const X&);

This has led to some confusion, so we would like to improve the diagnostic. For
example, if overload resolution finds nothing or is ambiguous, we could
consider adding candidates that shouldn't be visible (but other compilers
sometimes see anyway), and, if those candidates are chosen, emit a specific
diagnostic about the reason they aren't actually visible.

-- 
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