[Bug c++/79746] Confusing -Wunused-but-set-parameter warning with virtual inheritance
sgunderson at bigfoot dot com
gcc-bugzilla@gcc.gnu.org
Tue Feb 28 15:52:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79746
--- Comment #1 from sgunderson at bigfoot dot com ---
Actually this is interesting; this code (derived from the previous one)
compiles without warning in GCC 7.0 and Clang, but gives an error in GCC 6.3:
struct Base {
Base(const char *foo) : m_foo(foo) {}
virtual int func() = 0;
const char *m_foo;
};
struct Derived : public virtual Base {
Derived(const char *foo) { (void)foo; }
};
Which compiler is right?
More information about the Gcc-bugs
mailing list