This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/71517] New: g++ gives different warnings if compiling a file directly or adding preprocess step
- From: "albert.astals at canonical dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 13 Jun 2016 07:49:06 +0000
- Subject: [Bug c++/71517] New: g++ gives different warnings if compiling a file directly or adding preprocess step
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71517
Bug ID: 71517
Summary: g++ gives different warnings if compiling a file
directly or adding preprocess step
Product: gcc
Version: 5.3.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: albert.astals at canonical dot com
Target Milestone: ---
Compiling the file at http://paste.ubuntu.com/17091697/
I get no warnings if just using -c
$ g++ -c -fPIC -Wsuggest-override -isystem /usr/include/x86_64-linux-gnu/qt5/
q.cpp
$
But if i add -E step i do get warnings
$ g++ -E -fPIC -Wsuggest-override -isystem /usr/include/x86_64-linux-gnu/qt5/
q.cpp > preprocess.cpp
$ g++ -c -fPIC -Wsuggest-override -isystem /usr/include/x86_64-linux-gnu/qt5/
preprocess.cpp
q.cpp:5:75: warning: âvirtual const QMetaObject* Moo::metaObject() constâ can
be marked override [-Wsuggest-override]
q.cpp:5:109: warning: âvirtual void* Moo::qt_metacast(const char*)â can be
marked override [-Wsuggest-override]
q.cpp:5:148: warning: âvirtual int Moo::qt_metacall(QMetaObject::Call, int,
void**)â can be marked override [-Wsuggest-override]
$
Don't know if the warning should be reported in the first case or not reported
in the second case but seems a bit inconsistent to have it in one case and not
in the other.