This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/12831] [3.3 regression] ICE with passing reference to bound pointer-to-member-function
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 29 Oct 2003 21:43:16 -0000
- Subject: [Bug c++/12831] [3.3 regression] ICE with passing reference to bound pointer-to-member-function
- References: <20031029204152.12831.waldeinburg@yahoo.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12831
bangerth at dealii dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|critical |normal
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Keywords| |ice-on-invalid-code
Last reconfirmed|0000-00-00 00:00:00 |2003-10-29 21:43:15
date| |
Summary|passing reference to |[3.3 regression] ICE with
|pointer-to-member-function |passing reference to bound
|crashes gcc 3.3.2 |pointer-to-member-function
Target Milestone|--- |3.3.3
------- Additional Comments From bangerth at dealii dot org 2003-10-29 21:43 -------
The code is illegal: you are calling quz::qoo with
ifoo.*fun
which is a bound pointer to member (another ill-advised gcc extension).
You should really call it as
iquz.qoo (fun)
in which case all gcc versions accept the code.
Alas, the present state is not good either. 3.3.x ICEs on the code, which
one can consider a regression against 2.95 that silently accepted wrong
code. Present mainline states
g/x> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -c x.cc
x.cc: In function `int main()':
x.cc:16: error: no matching function for call to `quz<void
(foo::*)()>::qoo(void (foo::)())'
x.cc:7: note: candidates are: void quz<T>::qoo(T&) [with T = void (foo::*)()]
which is confusing because the data types do not reflect that we try to
call the function with a bound pointer.
That raises an interesting question, though: does there exist a standard
conversion from a bound pointer to an unbound one? If this were the case,
then the message would suddenly make sense: we would convert the bound
reference to member to an unbound reference to member and call quz::qoo with
that. It would take a reference-to-pointer conversion then.
To wrap up: don't invent half-baked extensions to the language (a message to
gcc developers)!
W.