<html>
<head>
<base href="https://llvm.org/bugs/" />
</head>
<body><span class="vcard"><a class="email" href="mailto:chisophugis@gmail.com" title="Sean Silva <chisophugis@gmail.com>"> <span class="fn">Sean Silva</span></a>
</span> changed
<a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED INVALID - Unexpected divergence between -fmodules and not (due to "<undeserialized declarations>"?)"
href="https://llvm.org/bugs/show_bug.cgi?id=24425">bug 24425</a>
<br>
<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>What</th>
<th>Removed</th>
<th>Added</th>
</tr>
<tr>
<td style="text-align:right;">Status</td>
<td>NEW
</td>
<td>RESOLVED
</td>
</tr>
<tr>
<td style="text-align:right;">Resolution</td>
<td>---
</td>
<td>INVALID
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED INVALID - Unexpected divergence between -fmodules and not (due to "<undeserialized declarations>"?)"
href="https://llvm.org/bugs/show_bug.cgi?id=24425#c5">Comment # 5</a>
on <a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED INVALID - Unexpected divergence between -fmodules and not (due to "<undeserialized declarations>"?)"
href="https://llvm.org/bugs/show_bug.cgi?id=24425">bug 24425</a>
from <span class="vcard"><a class="email" href="mailto:chisophugis@gmail.com" title="Sean Silva <chisophugis@gmail.com>"> <span class="fn">Sean Silva</span></a>
</span></b>
<pre>(In reply to <a href="show_bug.cgi?id=24425#c4">comment #4</a>)
<span class="quote">> (In reply to <a href="show_bug.cgi?id=24425#c3">comment #3</a>)
> > It's actually not clear to me what `template <typename T> char
> > Foo<T>::s_bar;` in the .cpp file even means from a language perspective.
> > Since it is templated, this doesn't really concretely define anything, so
> > what is its purpose? (forgive my ignorance of this part of the language)
>
> This is providing a definition for the static data member. It's a bit weird
> that the language requires this, but the idea is that it's a template from
> which you would instantiate a definition of the static data member ("char
> Foo<int>::s_bar;"), and you can put an initializer there and the like.</span >
Okay, I can see it now. Makes sense to be able to do `template <typename T>
char Foo<T>::s_bar = traits<T>::baz;` or the like.
<span class="quote">>
> The code as it stands is a more complex variant of this:
>
> a.h:
>
> template<typename T> void f();
> inline void g() { f<int>(); }
>
> a.cpp:
>
> template<typename T> void f() {}
>
> ... which is a very broken thing to try to do.</span >
Ah! makes perfect sense! This is a lot clearer for me intuitively from the
perspective of functions.
Since this arose in the wild, I'm going to follow up internally and investigate
a bit more exactly how this came up and how much of a chance users would have
at working around this if they encountered it (and also how likely they are to
encounter it).
If this turns out to be a showstopper for modules in the wild, we'll have to
investigate a way to rectify the situation, but that may be done better as a
check in modularize, clang-tidy, or whatever than as a change in the core of
the compiler.
It will be a separate discussion and issue anyhow, so marking this bug as
INVALID.
Thanks for all your help Richard!</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>