[cfe-commits] [Patch] Print differences for function pointers.
Richard Trieu
rtrieu at google.com
Tue Nov 15 12:23:03 PST 2011
New feature that will print additional information when non-matching
function pointers are used. This will help users more easily distinguish
why the function pointers do not match. The points of difference that will
be noted are:
Different number of parameters
Different parameter type
Different return type
Different function qualifiers
For instance, code like this:
double foo(int x) {return 0;};
double (*bar)(int, int) = &foo;
Will get this error message:
function-mismatch.cc:2:10: error: cannot initialize a variable of
type 'double (*)(int, int)' with an rvalue of type 'double (*)(int)'
because of different number of parameters (expected 2 but has 1)
double (*bar)(int, int) = &foo;
^ ~~~~
Patch is attached and also available at
http://codereview.appspot.com/5369119/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20111115/6f0642ad/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: function-pointer.patch
Type: text/x-patch
Size: 21116 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20111115/6f0642ad/attachment.bin>
More information about the cfe-commits
mailing list