[LLVMbugs] [Bug 13462] New: assert when combining attribute((overloadable)) with address-of-function expression

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Jul 25 16:12:28 PDT 2012


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

             Bug #: 13462
           Summary: assert when combining attribute((overloadable)) with
                    address-of-function expression
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: richard-llvm at metafoo.co.uk
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


This code causes Clang to assert:

void f(void) __attribute__((overloadable));
void f(int) __attribute__((overloadable));
void (*p)() = &f;


Output:

<stdin>:1:100: error: reference to overloaded function could not be resolved;
did you mean to call it with no arguments?
void f(void) __attribute__((overloadable)); void f(int)
__attribute((overloadable)); void (*p)() = &f;
                                                                               
                   ^~
<stdin>:1:50: note: possible target for call
void f(void) __attribute__((overloadable)); void f(int)
__attribute((overloadable)); void (*p)() = &f;
                                                 ^
<stdin>:1:6: note: possible target for call
void f(void) __attribute__((overloadable)); void f(int)
__attribute((overloadable)); void (*p)() = &f;
     ^
<stdin>:1:93: error: initializing 'void (*)()' with an expression of
incompatible type '<overloaded function type>'
void f(void) __attribute__((overloadable)); void f(int)
__attribute((overloadable)); void (*p)() = &f;
                                                                               
            ^      ~~~
clang-3.2: src/tools/clang/include/clang/AST/ExprCXX.h:2311: static
clang::OverloadExpr::FindResult clang::OverloadExpr::find(clang::Expr *):
Assertion `E->getType()->isSpecificBuiltinType(BuiltinType::Overload)' failed.


This code should probably be accepted, like it is in C++ mode.

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