-
Notifications
You must be signed in to change notification settings - Fork 15.7k
Description
| Bugzilla Link | 20337 |
| Resolution | FIXED |
| Resolved on | Sep 07, 2015 01:04 |
| Version | unspecified |
| OS | All |
| Blocks | #12849 |
| CC | @majnemer,@zygoloid,@rnk |
Extended Description
(similar to issue 20221, but this is with clang r213197, so it does have the fix for that)
Consider:
$ cat test.cc
template class OwnPtr {
public:
~OwnPtr()
{
_Static_assert((sizeof(T) > 0), "TypeMustBeComplete");
}
};
class SVGElement {
public:
virtual ~SVGElement();
};
class ScriptLoader;
class SVGScriptElement final : public SVGElement {
virtual bool isStructurallyExternal() const { return hasSourceAttribute(); }
virtual bool hasSourceAttribute() const ;
OwnPtr<ScriptLoader> m_loader;
};
$ ../../llvm-build/bin/clang -c test.cc -std=c++11 # Works.
$ ../../llvm-build/bin/clang -c test.cc -target i386-pc-windows-msvc
test.cc:5:25: error: invalid application of 'sizeof' to an incomplete type 'ScriptLoader'
_Static_assert((sizeof(T) > 0), "TypeMustBeComplete");
^~~~~~~~~
test.cc:16:7: note: in instantiation of member function 'OwnPtr::~OwnPtr' requested here
class SVGScriptElement final : public SVGElement {
^
test.cc:14:7: note: forward declaration of 'ScriptLoader'
class ScriptLoader;
^
1 error generated.
This builds fine with cl.exe too.