This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/59621] New: wrong caret / lineno for wrong ctor field initializer
- From: "jan.kratochvil at redhat dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 29 Dec 2013 11:27:36 +0000
- Subject: [Bug c++/59621] New: wrong caret / lineno for wrong ctor field initializer
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59621
Bug ID: 59621
Summary: wrong caret / lineno for wrong ctor field initializer
Product: gcc
Version: 4.8.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: jan.kratochvil at redhat dot com
CC: dodji at gcc dot gnu.org
Target: x86_64-unknown-linux-gnu
class C {
public:
void *ap,*bp;
C(int i,void *p):ap(i)
,bp(p)
{}
};
g++ -c cxxctor.C -Wall -g
FAIL: gcc (GCC) 4.8.3 20131023 (prerelease)
FAIL: gcc (GCC) 4.9.0 20131119 (experimental)
FAIL: gcc-c++-4.8.2-7.fc19.x86_64
cxxctor.C: In constructor âC::C(int, void*)â:
cxxctor.C:5:8: error: invalid conversion from âintâ to âvoid*â [-fpermissive]
,bp(p)
^
PASS: clang-3.3-3.fc19.x86_64
cxxctor.C:4:20: error: cannot initialize a member subobject of type 'void *'
with an lvalue of type 'int'
C(int i,void *p):ap(i)
^ ~
1 error generated.
The error may be really confusing for many non-trivial ctor parameters.