--- Comment #18 from bangerth at math dot tamu dot edu 2008-04-02 18:34
---
Subject: Re: Pure virtual method body omitted from template
> You are absolutely right as long as there is no multithreading and no
> dangling pointer. Sure. The thing is: If it's called, something bad has
>
--- Comment #17 from bangerth at math dot tamu dot edu 2008-04-02 18:31
---
Subject: Re: Pure virtual method body omitted from template
On Wednesday 02 April 2008 12:15:53 yuriry at gmail dot com wrote:
> My question is slightly off topic but I am really interested in the purpose
> o
--- Comment #16 from yuriry at gmail dot com 2008-04-02 17:58 ---
Thanks for the reply, David! But now I have more questions than I had before
:-)
I'm not sure if this thread is the right place to go into details on this
topic. If you know any other place to move this discussion, plea
--- Comment #15 from fang at csl dot cornell dot edu 2008-04-02 17:38
---
Unused template parameters can be used when you want to intentionally subtype a
base type with different flavors that are incompatible with each other, using
compile-time checking to prevent accidental cross-conta
--- Comment #14 from yuriry at gmail dot com 2008-04-02 17:15 ---
Hi Björn
My question is slightly off topic but I am really interested in the purpose of
defining a template class where a template parameter is not used. Why would
you need this?
Regards,
Yuri
template
class TBase
{
pu
--- Comment #13 from herwig at gdsys dot de 2008-04-02 16:07 ---
(In reply to comment #12)
> The point I meant to make but failed is: a pure virtual method can *only*
> *ever* be called explicitly. It can't be called through the vtable because
> there can be no objects of the type of t
--- Comment #12 from bangerth at math dot tamu dot edu 2008-04-02 13:31
---
Subject: Re: Pure virtual method body omitted from template
> No, it is not. And that's because this pure virtual method never gets called
> explicitly.
The point I meant to make but failed is: a pure virtua
--- Comment #11 from herwig at gdsys dot de 2008-04-02 07:17 ---
(In reply to comment #10)
> Yes. Since the class declaration must be visible from the place where you
> call this function, and since then also the function's definition
> (=implementation) is visible, the template should
--- Comment #10 from bangerth at math dot tamu dot edu 2008-04-01 14:44
---
Subject: Re: Pure virtual method body omitted from template
> Or did you mean that the function definition is in the TBase header file? If
> so: It is.
Yes. Since the class declaration must be visible from t
--- Comment #9 from herwig at gdsys dot de 2008-04-01 14:38 ---
(In reply to comment #8)
> Subject: Re: Pure virtual method body omitted from template
>
>
> > thanks for the clarification. I should have realized it myself, though. I
> > solved the problem in another way, but out of pu
--- Comment #8 from bangerth at math dot tamu dot edu 2008-04-01 12:52
---
Subject: Re: Pure virtual method body omitted from template
> thanks for the clarification. I should have realized it myself, though. I
> solved the problem in another way, but out of pure curiosity: How can I
--- Comment #7 from herwig at gdsys dot de 2008-04-01 07:58 ---
(In reply to comment #5)
> (In reply to comment #0)
> > The following stripped down code shows pure virtual method definitions for
> > both
> > a normal base class and a templated base class. To my surprise, the
> > templa
--- Comment #6 from yuriry at gmail dot com 2008-03-31 20:01 ---
Yes, it is legal, sorry confusion.
Yuri
(In reply to comment #4)
> (In reply to comment #3)
> > I believe that the main problem here is that GCC allows defining pure
> > virtual
> > functions.
>
> No, that's perfectly le
--- Comment #5 from bangerth at dealii dot org 2008-03-31 19:54 ---
(In reply to comment #0)
> The following stripped down code shows pure virtual method definitions for
> both
> a normal base class and a templated base class. To my surprise, the templated
> class' body is not generated
--- Comment #4 from bangerth at dealii dot org 2008-03-31 19:51 ---
(In reply to comment #3)
> I believe that the main problem here is that GCC allows defining pure virtual
> functions.
No, that's perfectly legal.
W.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33878
--- Comment #3 from yuriry at gmail dot com 2008-03-30 22:29 ---
I believe that the main problem here is that GCC allows defining pure virtual
functions. The compiler should report an error when these two functions are
defined:
//
void Base::pvMethod
--- Comment #2 from herwig at gdsys dot de 2007-11-20 07:54 ---
(In reply to comment #1)
> 2.95.3 ICEd on this. I don't know if I can consider this a regression.
>
> Confirmed.
>
Shouldn't the keyword say "wrong-code" rather than "accepts-invalid"? Defining
a pure virtual method is v
--- Comment #1 from pinskia at gcc dot gnu dot org 2007-11-19 05:36 ---
2.95.3 ICEd on this. I don't know if I can consider this a regression.
Confirmed.
--
pinskia at gcc dot gnu dot org changed:
What|Removed |Added
-
18 matches
Mail list logo