Open GoogleCodeExporter opened 9 years ago
Don't know whether this is related, but might also happen with member functions
of template classes:
error: member access into incomplete type
Example, a member function is defined in a header file:
//headerfile
namespace somenamespace
{
template <class T> //don't know if this only happens for template classes
class Store : public StoreBase
{
public:
void write (ESM::ESMWriter& writer) const
{
writer.startRecord (T::sRecordId);
}
}
}
iwyu says i should add
namespace ESM { class ESMWriter; }
and should remove:
#include <components/esm/esmwriter.hpp> // lines 10-10
which then would cause
error: member access into incomplete type
(full example file here:
https://github.com/OpenMW/openmw/blob/master/apps/openmw/mwworld/store.hpp)
Original comment by showard...@gmail.com
on 7 Feb 2015 at 5:58
Thanks for the bug report, showard314. I was able to reproduce it with
`std::vector<std::pair<int, IndirectClass> >`. By the way, just `std::pair<int,
IndirectClass>` requires full use of IndirectClass. My current guess is that we
correctly detect we need full use of std::pair, but we don't check full use,
forward-declare use for std::pair template arguments.
Original comment by vsap...@gmail.com
on 10 Feb 2015 at 3:21
Original issue reported on code.google.com by
showard...@gmail.com
on 7 Feb 2015 at 5:41