c++/353: gcc reports both existence and non existence of constructor of template class.correct error message for legal template code with method pointer
brussee@mathematik.uni-bielefeld.de
brussee@mathematik.uni-bielefeld.de
Tue Jun 27 09:26:00 GMT 2000
>Number: 353
>Category: c++
>Synopsis: gcc reports both existence and non existence of constructor of template class.correct error message for legal template code with method pointer
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: rejects-legal
>Submitter-Id: net
>Arrival-Date: Tue Jun 27 09:26:01 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator: brussee@mathematik.uni-bielefeld.de
>Release: unknown-1.0
>Organization:
>Environment:
gcc 2.95.2 on intel linux.
>Description:
gcc gave following error messages
no matching function for call to `Y<int ()()>::Y (int (X::*)())'
candidates are: Y<int ()()>::Y(int ( X::*)())
Y<int ()()>::Y(const Y<int ()()> &)
for following program
struct X{
int blah();
};
template<class T>
struct Y{
T X::* t_;
Y(T X::* t): t_(t){};
};
Y<int()> y1(&X::blah);
>How-To-Repeat:
compile.
>Fix:
specialise the template for R(), R(T1), R(T1,T2) etc.
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="test4.cxx"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="test4.cxx"
CnN0cnVjdCBYewogIGludCBibGFoKCk7Cn07CgoKdGVtcGxhdGU8Y2xhc3MgVD4Kc3RydWN0IFl7
CgogIFQgWDo6KiB0XzsKCiAgWShUIFg6OiogdCk6IHRfKHQpe307Cgp9OwoKClk8aW50KCk+IHkx
KCZYOjpibGFoKTsKWTxpbnQoKT4geTIgPSBZPGludCgpPigmWDo6YmxhaCk7Clk8aW50KCk+KiBw
ID0gbmV3IFk8aW50KCk+KCZYOjpibGFoKTsKCgp0ZW1wbGF0ZTxjbGFzcyBTaWc+CnN0cnVjdCBa
OwoKdGVtcGxhdGU8Y2xhc3MgUj4Kc3RydWN0IFo8UigpPnsKCiAgUiAoWDo6KiB0XykoKTsKCiAg
WihSIChYOjoqIHQpKCkgKTogdF8odCl7fTsKCn07CgoKWjxpbnQoKT4gejEoJlg6OmJsYWgpOwpa
PGludCgpPiB6MiA9IFo8aW50KCk+KCZYOjpibGFoKTsKWjxpbnQoKT4qIHEgPSBuZXcgWjxpbnQo
KT4oJlg6OmJsYWgpOwoKCgoKCgoKCgoKCgo=
More information about the Gcc-prs
mailing list