[LLVMbugs] [Bug 22039] New: clang accepts ambiguous function name lookup when using operator()

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Dec 27 19:11:48 PST 2014


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

            Bug ID: 22039
           Summary: clang accepts ambiguous function name lookup when
                    using operator()
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: ryan.burn at gmail.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

clang accepts this code:
#include <iostream>                                                             

struct A {                                                                      
  void operator()(int) {                                                        
    std::cout << "A::f\n";                                                      
  }                                                                             
};                                                                              

struct B {                                                                      
  void operator()() {                                                           
    std::cout << "B::f\n";                                                      
  }                                                                             
};                                                                              

struct C                                                                        
  : A, B                                                                        
{                                                                               
};                                                                              

int main() {                                                                    
  C c;                                                                          
  c();                                                                          
  return 0;                                                                     
} 

which should give an ambiguous name lookup error. Both gcc and intel's compiler
correctly give the operator() is ambiguous error

-- 
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/20141228/82d4135a/attachment.html>


More information about the llvm-bugs mailing list