public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/104734] New: -isystem hides -Woverloaded-virtual warning
@ 2022-03-01 11:57 albert.astals.cid at kdab dot com
  2022-03-03 23:47 ` [Bug c++/104734] " pinskia at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: albert.astals.cid at kdab dot com @ 2022-03-01 11:57 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104734

            Bug ID: 104734
           Summary: -isystem hides -Woverloaded-virtual warning
           Product: gcc
           Version: 11.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: albert.astals.cid at kdab dot com
  Target Milestone: ---

I have a class that inherits from a class that is a system header.

The system header class has

virtual bool edit(const QModelIndex &index, EditTrigger trigger, QEvent
*event);

my class has

bool edit(const QModelIndex &index, int editDay);

when compiling with -I to add include paths i get

In file included from /usr/include/qt/QtWidgets/qtreeview.h:44,
                 from /usr/include/qt/QtWidgets/QTreeView:1,
                 from
/home/tsdgeos/kdab/private/KDABViewer/Widgets/TimelineWidget.h:4,
                 from
/home/tsdgeos/kdab/private/KDABViewer/Widgets/TimelineWidget.cpp:1:
/usr/include/qt/QtWidgets/qabstractitemview.h:297:18: warning: ‘virtual bool
QAbstractItemView::edit(const QModelIndex&, QAbstractItemView::EditTrigger,
QEvent*)’ was hidden [-Woverloaded-virtual]
  297 |     virtual bool edit(const QModelIndex &index, EditTrigger trigger,
QEvent *event);
      |                  ^~~~
In file included from
/home/tsdgeos/kdab/private/KDABViewer/Widgets/TimelineWidget.cpp:1:
/home/tsdgeos/kdab/private/KDABViewer/Widgets/TimelineWidget.h:66:10: note:  
by ‘bool TimelineWidget::edit(const QModelIndex&, int)’
   66 |     bool edit(const QModelIndex &index, int editDay);
      |          ^~~~

but if instead of -I i use -isystem the warning is gone.

This feels wrong since the warning is about my code, not about the system
include code.

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

end of thread, other threads:[~2022-03-16  9:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-01 11:57 [Bug c++/104734] New: -isystem hides -Woverloaded-virtual warning albert.astals.cid at kdab dot com
2022-03-03 23:47 ` [Bug c++/104734] " pinskia at gcc dot gnu.org
2022-03-09  9:22 ` albert.astals.cid at kdab dot com
2022-03-09  9:22 ` albert.astals.cid at kdab dot com
2022-03-09  9:23 ` albert.astals.cid at kdab dot com
2022-03-16  8:46 ` albert.astals.cid at kdab dot com
2022-03-16  9:51 ` redi 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).