public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/51851] New: Overriding a function with a parameter of dependent type fails to override.
@ 2012-01-13 19:13 ville.voutilainen at gmail dot com
  2012-01-13 20:07 ` [Bug c++/51851] " ville.voutilainen at gmail dot com
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: ville.voutilainen at gmail dot com @ 2012-01-13 19:13 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51851

             Bug #: 51851
           Summary: Overriding a function with a parameter of dependent
                    type fails to override.
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: ville.voutilainen@gmail.com


Test snippet:

template<class T>
struct A
{
       typedef double Point[2];
       virtual double calculate(const Point point) const = 0;
};

template<class T>
struct B : public A<T>
{
       virtual double calculate(const typename A<T>::Point point) const
       {
               return point[0];
       }
};

int main()
{
       B<int> b;
       return 0;
}

gcc says
ville.cpp: In function ‘int main()’:
ville.cpp:19:16: error: cannot declare variable ‘b’ to be of abstract type
‘B<int>’
ville.cpp:9:8: note:   because the following virtual functions are pure within
‘B<int>’:
ville.cpp:5:24: note:     double A<T>::calculate(const double*) const [with T =
int]


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-10-15 21:00 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-13 19:13 [Bug c++/51851] New: Overriding a function with a parameter of dependent type fails to override ville.voutilainen at gmail dot com
2012-01-13 20:07 ` [Bug c++/51851] " ville.voutilainen at gmail dot com
2012-01-13 21:12 ` jason at gcc dot gnu.org
2021-07-12 16:57 ` [Bug c++/51851] [core/1001] " mpolacek at gcc dot gnu.org
2021-08-23 12:31 ` nickhuang99 at hotmail dot com
2021-08-23 13:41 ` redi at gcc dot gnu.org
2021-08-23 13:43 ` redi at gcc dot gnu.org
2021-08-23 14:10 ` nickhuang99 at hotmail dot com
2021-10-15 21:00 ` cvs-commit at gcc dot gnu.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).