public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/12041] New: No overload search in evaluation of template parameter default value
@ 2003-08-23 13:20 raoulgough at yahoo dot co dot uk
2003-08-23 13:26 ` [Bug c++/12041] " pinskia at gcc dot gnu dot org
0 siblings, 1 reply; 2+ messages in thread
From: raoulgough at yahoo dot co dot uk @ 2003-08-23 13:20 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12041
Summary: No overload search in evaluation of template parameter
default value
Product: gcc
Version: 3.3.1
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: raoulgough at yahoo dot co dot uk
CC: gcc-bugs at gcc dot gnu dot org
GCC host triplet: i686-pc-mingw
How to reproduce. File overload.cc:
-----8<-------
struct A { };
struct B { };
char foo (A const &);
short foo (B const &);
template<typename T, unsigned Size = sizeof(foo(T()))>
struct bar {};
int main () {
bar<A>();
bar<B>();
}
-----8<-------
$ g++ -c overload.cc
overload.cc: In function `int main()':
overload.cc:11: error: could not convert `A()' to `const B&'
overload.cc:5: error: in passing argument 1 of `short int foo(const B&)'
overload.cc:11: error: template argument 2 is invalid
I think that this is *different* to bug 6424 and core language issue 339
because it does not involve any function template parameter deduction (and the
error message is different, too). It seems like g++ is only considering the
most recently seen version of foo(), since reversing the declaration order of
the two overloads produces a transposed error message:
short foo (B const &);
char foo (A const &);
// ...
overload.cc: In function `int main()':
overload.cc:12: error: could not convert `B()' to `const A&'
overload.cc:5: error: in passing argument 1 of `char foo(const A&)'
overload.cc:12: error: template argument 2 is invalid
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Bug c++/12041] No overload search in evaluation of template parameter default value
2003-08-23 13:20 [Bug c++/12041] New: No overload search in evaluation of template parameter default value raoulgough at yahoo dot co dot uk
@ 2003-08-23 13:26 ` pinskia at gcc dot gnu dot org
0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-08-23 13:26 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12041
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Keywords| |rejects-valid
Resolution| |FIXED
Target Milestone|--- |3.4
------- Additional Comments From pinskia at gcc dot gnu dot org 2003-08-23 13:26 -------
I can reproduce it in 3.3.1 but on the mainline (20030823), this is already fixed, since this is not a
regression, I am closing this as fixed.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-08-23 13:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-23 13:20 [Bug c++/12041] New: No overload search in evaluation of template parameter default value raoulgough at yahoo dot co dot uk
2003-08-23 13:26 ` [Bug c++/12041] " pinskia at gcc dot gnu dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).