https://bugs.llvm.org/show_bug.cgi?id=49310

            Bug ID: 49310
           Summary: [C++4OpenCL] Inconsistent diagnostics for taking
                    function address
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: OpenCL
          Assignee: unassignedclangb...@nondot.org
          Reporter: anastasia.stul...@arm.com
                CC: anastasia.stul...@arm.com, llvm-bugs@lists.llvm.org

An inconsistent diagnostic is given when function addresses are taken i.e.
template functions are not diagnosed while normal functions are.

template<class T>
void f1(){}

void f2(){}

void bar(){
    f1<int>;
    f2;//error: taking address of function is not allowed
}

It is not clear though why the diagnostic was added since OpenCL C never
restricted taking addresses of functions. Perhaps it was considered useless
since function pointers can't be used. However, taking an address doesn't imply
that the function will necessarily be called even if it is the most common use
case. In addition to that, the diagnostic is handled in Parser and not Sema
where it conceptually belongs. Potentially we need to see if we can just remove
the diagnostic.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to