[LLVMbugs] [Bug 7095] New: Error: Ambiguous user-defined conversion sequence

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri May 7 15:30:51 PDT 2010


           Summary: Error: Ambiguous user-defined conversion sequence
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          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

terfin:clang dgregor$ cat t3.cpp 
struct X { };

struct Y {
  operator const X*();
  operator X*();

void f(const X *);
void g(Y y) { f(y); }
terfin:clang dgregor$ clang++ t3.cpp 
t3.cpp:9:17: error: conversion from 'Y' to 'X const *' is ambiguous
void g(Y y) { f(y); }
t3.cpp:4:3: note: candidate function
  operator const X*();
t3.cpp:5:3: note: candidate function
  operator X*();
t3.cpp:8:17: note: passing argument to parameter here
void f(const X *);
1 error generated.
terfin:clang dgregor$ g++ -fsyntax-only t3.cpp 
terfin:clang dgregor$ eccp t3.cpp 
terfin:clang dgregor

Revert commit r103312 when this is fixed.

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