[LLVMbugs] [Bug 16570] New: Wrong diagnostic for mismatching function types

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Jul 9 04:26:07 PDT 2013


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

            Bug ID: 16570
           Summary: Wrong diagnostic for mismatching function types
           Product: clang
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: eugeni.stepanov at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

$ cat 1.cc
typedef void (*F)(const char * __restrict__, int);
void g(const char *, unsigned);
F f = g;

$ ./build/bin/clang++ -c 1.cc 
1.cc:6:3: error: cannot initialize a variable of type 'F' (aka 'void (*)(const
char *restrict, int)') with an lvalue of
      type 'void (const char *, unsigned int)': type mismatch at 1st parameter
('const char *restrict' vs
      'const char *')
F f = g;
  ^   ~
1 error generated.


The diagnostic should point to the second argument type.

-- 
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/20130709/adbf9aac/attachment.html>


More information about the llvm-bugs mailing list