http://llvm.org/bugs/show_bug.cgi?id=20337
Bug ID: 20337
Summary: "invalid application of 'sizeof' to an incomplete
type" in msvc mode
Product: clang
Version: unspecified
Hardware: PC
OS: All
Status: NEW
Severity: normal
Priority: P
Component: Frontend
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Classification: Unclassified
(similar to issue 20221, but this is with clang r213197, so it does have the
fix for that)
Consider:
$ cat test.cc
template<typename T> 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<ScriptLoader>::~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.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs