This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] handling of 'operator' in cp_find_first_component


On 23 Apr 2003 16:27:03 -0700, David Carlton <carlton at math dot stanford dot edu> said:

> Hmm.  I'm confused.  When I play around with this further, life is
> getting more bizarre: GCC happily compiles the following:

> class C {};

> template <typename T> int foo(int a)
> {
>   return C();
> }
> template <typename T> T foo (T a)
> {
>   return 10;
> }

> even though the first function is returning an object of the wrong
> type!  Am I going crazy, or is that just a bug?

No, it's not a bug: it's just that the error isn't signalled until the
template is instantiated, which I wasn't doing.  Silly me.

David Carlton
carlton at math dot stanford dot edu


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]