[LLVMbugs] [Bug 18776] New: AST printer doesn't handle conversion operators correctly

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Feb 8 07:07:05 PST 2014


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

            Bug ID: 18776
           Summary: AST printer doesn't handle conversion operators
                    correctly
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: benny.kra at gmail.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

$ cat t.cc
struct A {
  operator void*();
  A operator &(A);
};

void bar(void *);

void foo() {
  A a, b;
  bar(a & b);
}

$ clang -cc1 -ast-print t.cc
struct A {
    void *operator void *();
    A operator&(A);
};
void bar(void *);
void foo() {
    A a, b;
    bar(a & b.operator void *());
}

===

1. Printing a return type on a conversion operator is invalid.
2. If we really want to print the conversion operator call it should emit "(a &
b).operator void *()" to avoid changing behavior.

-- 
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/20140208/8ec3eb43/attachment.html>


More information about the llvm-bugs mailing list