http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54055
Bug #: 54055 Summary: spurious(?) "invalid use of incomplete type" warning in template definition Classification: Unclassified Product: gcc Version: 4.8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassig...@gcc.gnu.org ReportedBy: rol...@gnu.org Created attachment 27847 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27847 test case, C++ source The attached input file is culled from Chromium sources. Past versions of GCC do not complain about this and nor does Clang. Trunk G++ started giving a warning fairly recently (sometime after I left for Prague). It happens with no special options, and also with -std=gnu++98; I didn't test other modes. foo.cc:3:35: warning: invalid use of incomplete type ‘class scoped_ptr<C>’ [enabled by default] private: struct RValue : public scoped_ptr { RValue(); ~RValue(); RValue(cons ^ foo.cc:2:7: warning: declaration of ‘class scoped_ptr<C>’ [enabled by default] class scoped_ptr { ^ This code pattern comes from using the macro MOVE_ONLY_TYPE_FOR_CPP_03 as defined here: http://src.chromium.org/viewvc/chrome/trunk/src/base/move.h?view=markup Is this code really invalid C++? If so, was it intended to start rejecting it without any new -std= or -Wfoo options when G++ never did before?