Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

Poor handling of erroneous return type #9414

Open Quuxplusone opened 13 years ago

Quuxplusone commented 13 years ago
Bugzilla Link PR9047
Status NEW
Importance P normal
Reported by Chris Lattner (clattner@nondot.org)
Reported on 2011-01-24 22:40:03 -0800
Last modified on 2011-01-25 04:02:40 -0800
Version unspecified
Hardware PC All
CC chris@bubblescope.net, dgregor@apple.com, llvm-bugs@lists.llvm.org
Fixed by commit(s)
Attachments
Blocks
Blocked by
See also
$ cat t2.cc
const foo *Bar() { return 42; }

$ clang t2.cc
t2.cc:3:7: error: unknown type name 'foo'
const foo *Bar() { return 42; }
      ^
t2.cc:3:27: error: cannot initialize return object of type 'const int *' with
an rvalue of type 'int'
const foo *Bar() { return 42; }
                          ^~

What is this "const int *" that you speak of??

-Chris
Quuxplusone commented 13 years ago

Apologises for the 'me too' style reply, but I just wanted to say that g++'s habit of producing errors with 'int' in place of mis-spelt types produces many of the error messages that I find most confuse students I teach.

Any way of getting rid of such messages in clang would be very useful.