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

           Summary: Dependent conversion function names looked up in
                    dependent bases
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]


This code is ill-formed. Unqualified names should not be looked up in dependent
base classes, no matter whether they are dependent or not, according to the
Standard.

template<typename T>
struct A {
  operator int() { return 0; }
};

template<typename T>
struct B : A<T> {
  int f() { return operator T(); }
};

int main() {
  return B<int>().f();
}

Clang accepts it, though. And it's easy to construct an rejects-valid for this,
just add another non-dependent base that also has an "operator int" declared,
and you wrongly get an ambiguity diagnostic.

-- 
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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to