<html>
<head>
<base href="http://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - "invalid application of 'sizeof' to an incomplete type" in msvc mode"
href="http://llvm.org/bugs/show_bug.cgi?id=20337">20337</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>"invalid application of 'sizeof' to an incomplete type" in msvc mode
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Frontend
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>nicolasweber@gmx.de
</td>
</tr>
<tr>
<th>CC</th>
<td>llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>(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.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>