<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=http://email.email.llvm.org/c/eJy9VMGOnDAM_Rq4WCBIZnaYA4fdma7aQ889ViEYSBUSlITZ7d_XBGZnV9vtpVUlFBzbsZ-fnTS2_Vl_6SAMCL22jdAw2nbWCJ0T_YgmgO1AGFAmoOuERJiNCrSVem7RQ3JXSB9a4XqSEnYi3zb6j5PG5bwIypr10JoA32V4CUY-wdolCuExS-yL-O6DcIFEQNN6mCcwNkCDyvTQYqcMthQgFvCbnHlSnJPi_jM6Mvvo5XByBEAuPgm_Xx3WVeRymjYFVbN-cbtCTvjDZmV8Aw0JP10J4J9WKz5P1oVrmeJ26m3MLeeC-t_kfZ8wrtQ6COhDwqpFNAu_eZ4n7Lh5HTZ3AKJbKx_gol9iROXaA1aRnp3McvKNmTqzGV8bHIbZGShucA7nPxBxsuOk9No6aceRBsnf-vP2hNTC9Al7oA-yb0JryIiLhJ_lqmQiKrRqSEervPp2C9tKqpCtZPn3qmwU06J-ccgmhzKCQ8ieYYuVXdleegeZJWGS4_-GR-ZlPM4iZodMwkfzlLY1b4_8KFIxh8G6eph7K8Z0droeQpgi1-yRvl6FYW5yKpk2Wl-uP-LB_kBJc_CovJ_Rk7DnvCrTocbdTopDUx13vNu3VXm3q4pdxRrJxWHPiy7VokHt62RPhTKDTxBDkJzsz-nfI1A1KxgrSrYr2b4sWI4VY2W5b5GXJed3PNkVOAql8yVObl2fujqGbObek3EZe38zCu9VbxAjYEIYVNBYf92aQnfQOhqK10-X-ej9bHAQF2UdPFFVsN3Z-ExeL1Yai6ljJb8A3Y673A>53381</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Modules incorrect includes in global module fragment behavior with cstdarg and va_start
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          hugoam
      </td>
    </tr>
</table>

<pre>
    If the global module fragment of an interface unit includes `cstdarg`, and an implementation unit globale module fragment includes it too, then `va_start` ends up not being defined in the implementation unit.
Here is the reproduction:

a.cpp
```
module;
#include <cstdarg>
export module a;
```

aimpl.cpp
```
module;
#include <cstdarg>
module a;

int test(int n, ...)
{
  va_list vl;
  va_start(vl,n);
  va_end(vl);
  return 0;
}
```

Compilation commands:
```
clang++ -Wall -std=c++2a -stdlib=libc++ -fimplicit-modules -fimplicit-module-maps -fmodules --precompile -x c++-module a.cpp -o a.pcm
clang++ -Wall -std=c++2a -stdlib=libc++ -fimplicit-modules -fimplicit-module-maps -fmodule-file=aa.pcm -c aimpl.cpp
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy9VE1v2zAM_TX2hbBhS_k8-NAmG7bDzjsOskQ7GmTJkOS0-_ejZadp0XWnYYChUCTF9_RIpXXqV_O1g3hB6I1rhYHBqckgdF70A9oIrgNhQduIvhMSYbI60laaSWGAbFfJEJXwPVkZO1GuSvnDaHA-L6J2djm0AOA7hJdilBOdm6sQHzvXvoofIQofyQS0KsA0gnURWtS2B4WdtqioQLrAHzDLrDpn1cMX9BQOKcvj6ImAnHMy_rAkLKso5TiuDrrN8qXtQjnjj2uU8ZU0ZPx0E4B_WqL4PDofb9cU91Nva66YM-t_g_seMK3UOogYYsYOs2lnfcuyzNhxzdqv6QAkt9EhwtW81EjOpQfsQH52svPJN2HqzBp8HfAYJ2-hutPZn_8ixMkNozZL66QbBhqkcO_P2xPSCNtn7JE-KL4LY6AgLTJ-louTieQwuiUfrfKW281qa6ljsYgV3ruKQYyz-yWhGD3KRA6heIa1VnFTe-4dFI6MUQ7_mx6F5_E4i4QOhYSP5ilXDVdHfhR51NFg820FoHlyni74-hnaj_4LWryIq3YennS8wDp_6cnfhiSfvGkuMY6pd-wzfT3lTm1JEtLGmOvth3R1PwmYtjqECQMZW84PdX5pdvtO7Vt-UDvFEat6c6zVQSjO9nspWVfnRrRoQpNtSThm8QlSCbKz7TnXDasYq2q2qdm2rliJB8bqequQ1zXnO55tKhyENuXMo3S-z32TKLVTHyg4P4JwD4oQdG8RExzVF1O8ON9cpt6JIU_ITWL-G8TIpvk">