<html><head><meta http-equiv="Content-Type" content="text/html; charset=windows-1252"></head>

<style type="text/css">
  ins { text-decoration:none; font-weight:bold; background-color:#A0FFA0 }
  del { text-decoration:line-through; background-color:#FFA0A0 }
  blockquote.stdrepl { color: #000000; background-color: #FFFFA0;
                       border: 1px solid #EBEBB3; padding: 0.5em; }

  tab { padding-left: 4em; }
  tab3 { padding-left: 3em; }

</style>
<body>
<p align=right><b>P0713R1, 2018-02-08</b>
<br/>EWG, CWG
</p>

<p align=right>
<br/>Daveed Vandevoorde (daveed@edg.com)
</p>

<h1 align="center">Identifying Module Source</h1>

<p>
P0713R0 argued for requiring a leading syntactic marker to distinguish
<i>module units</i> from traditional translation units that are not module
units.  Discussion in Toronto concluded with a vote that supported that
direction (strongly favor: 3, favor: 18, neutral: 14, against: 3, strongly
against: 0) after the publication of the modules TS (now N4720).

This paper proposes wording specifically for implementing the leading marker
as the strawman proposal in P0713R0:

<tt><pre>
  module;
  ...
  export module X;
  ...
</pre></tt>


<h2>Changes to N4720</h2>

<p>
Change the definition of <i>translation-unit</i> in
paragraph 6.5/1 [basic.link] to:
</p>
<blockquote class="stdrepl">
	<i>translation-unit</i>:<br/>
	<tab><i>declaration-seq<sub>opt</sub></i><br/>
	<tab><i>module-unit<sub>opt</sub></i><br/>
	<br/>
	<i>module-unit</i>:<br/>
	<tab><i>single-module-unit</i><br/>
	<tab><i>mixed-module-unit</i><br/>
	<br/>
	<i>single-module-unit</i>:<br/>
	<tab><i>module-declaration</i> <i>declaration-seq<sub>opt</sub><i><br/>
	<br/>
	<i>mixed-module-unit</i>:<br/>
	<tab><tt>module ;</tt> <i>declaration-seq<sub>opt</sub><i>
		<i>single-module-unit</i><br/>
	<br/>
</blockquote>
<p>
and remove the definitions of <i>toplevel-declaration-seq</i> and
<i>toplevel-declaration</i>.
</p>

<p>
In [dcl.module.unit] 10.7.1 paragraph 1, delete one sentence as follows:
</p>
<ol>
	<li>
		A <i>module unit</i> is a translation unit that contains
		a <i>module-declaration</i>. A <i>named module</i> is the
		collection of module units with the same <i>module-name</i>.
		<del>A translation unit shall not contain more than one
		<i>module-declaration</i>.</del> A <i>module-name</i>
		has external linkage but cannot be found by name lookup.
	</li>
</ol>

</body></html>
