<html>
<head>
<base href="https://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 --- - [Modules] default ctor of member requires type to be visible when the containing class is instantiated"
href="https://llvm.org/bugs/show_bug.cgi?id=30576">30576</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>[Modules] default ctor of member requires type to be visible when the containing class is instantiated
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</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>Modules
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>benny.kra@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>dgregor@apple.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=17385" name="attach_17385" title="Packaged test case.">attachment 17385</a> <a href="attachment.cgi?id=17385&action=edit" title="Packaged test case.">[details]</a></span>
Packaged test case.
For this test case (also attached for convenience):
a.cc:
#include "a.h"
int main() {
C c;
}
a.h:
#include "b.h"
struct C {
Member m;
};
b.h:
struct Member {
Member() {}
};
module map:
module a { header "a.h" }
module b { header "b.h" }
Clang emits:
$ clang -fmodules cxx-default-ctor.cpp
In module 'a' imported from cxx-default-ctor.cpp:5:
Inputs/cxx-default-ctor/a.h:3:8: error: missing '#include "b.h"'; definition of
'Member' must be imported from module 'b' before it is required
struct C {
^
Inputs/cxx-default-ctor/b.h:1:8: note: previous definition is here
struct Member {
^
cxx-default-ctor.cpp:7:5: note: implicit default constructor for 'C' first
required here
C c;
^
It seems wrong to expose implementation details just because there's a default
ctor. Adding a user-defined ctor to 'Member' avoids the issue.</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>