This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/82008] New: nonnull attribute and multiple inheritance
- From: "joerg dot richter at pdv-fs dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 28 Aug 2017 12:37:20 +0000
- Subject: [Bug c++/82008] New: nonnull attribute and multiple inheritance
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82008
Bug ID: 82008
Summary: nonnull attribute and multiple inheritance
Product: gcc
Version: 7.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: joerg.richter@pdv-fs.de
Target Milestone: ---
cat > t.cc << EOF
struct Base1
{
char s;
};
struct Base2
{
char x;
};
struct Deriv : Base1, Base2
{};
void funcyyy( Base2* ) __attribute__((nonnull));
void funcxxx( Deriv* d )
{
funcyyy( d );
}
EOF
g++ -c t.cc -o t.o -Wall
template.cc: In function 'void funcxxx(Deriv*)':
template.cc:18:14: warning: null argument where non-null required (argument 1)
[-Wnonnull]
funcyyy( d );
If funcyyy is declared as taking Base1* it works without warning.