Skip to content

Commit 6bf2668

Browse files
author
cpprefjp-autoupdate
committed
update automatically
1 parent 1870eb5 commit 6bf2668

8 files changed

Lines changed: 3349 additions & 44 deletions

implementation-status.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,12 +164,12 @@
164164

165165
<p class="text-right"><small>
166166
最終更新日時(UTC):
167-
<span itemprop="datePublished" content="2026-05-26T10:32:06">
168-
2026年05月26日 10時32分06秒
167+
<span itemprop="datePublished" content="2026-06-25T06:15:02">
168+
2026年06月25日 06時15分02秒
169169
</span>
170170
<br/>
171171
<span itemprop="author" itemscope itemtype="http://schema.org/Person">
172-
<span itemprop="name">equal-l2</span>
172+
<span itemprop="name">Akira Takahashi</span>
173173
</span>
174174
が更新
175175
</small></p>
@@ -2115,7 +2115,7 @@ <h2><a href="#cpp26" id="cpp26">C++26言語機能の実装状況</a></h2>
21152115
<td></td>
21162116
</tr>
21172117
<tr>
2118-
<td>P4136R2: <span href="https://cpprefjp.github.io/lang/cpp26/line_is_not_in_line_with_existing_implementation.md.nolink"><code>#line</code>ディレクティブの制約を現実の実装に合わせて緩和する</span></td>
2118+
<td>P4136R2: <a href="lang/cpp26/line_is_not_in_line_with_existing_implementation.html"><code>#line</code>ディレクティブの制約を現実の実装に合わせて緩和する</a></td>
21192119
<td><code>#line 0</code><code>#line 2147483648</code>のような行番号指定を<a class="cpprefjp-defined-word" data-desc="プログラムが適格でないこと。コンパイルエラーなどになる" href="implementation-compliance.html#dfn-ill-formed">不適格</a>としていたが、条件付きサポートとして許可する</td>
21202120
<td></td>
21212121
<td>yes</td>

lang/cpp26.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,8 @@
176176

177177
<p class="text-right"><small>
178178
最終更新日時(UTC):
179-
<span itemprop="datePublished" content="2026-06-22T07:01:50">
180-
2026年06月22日 07時01分50秒
179+
<span itemprop="datePublished" content="2026-06-25T06:15:02">
180+
2026年06月25日 06時15分02秒
181181
</span>
182182
<br/>
183183
<span itemprop="author" itemscope itemtype="http://schema.org/Person">
@@ -447,7 +447,7 @@ <h3>プリプロセッサ</h3>
447447
<td>プリプロセッサとレキサーの文脈での「<a class="cpprefjp-defined-word" data-desc="未定義の動作。処理系は予期せぬ動作をする可能性がある。要するに動作保証対象外。undefined behavior (UB)。" href="../implementation-compliance.html#dfn-undefined-behavior">未定義動作</a>」用語を<a class="cpprefjp-defined-word" data-desc="プログラムが適格でないこと。コンパイルエラーなどになる" href="../implementation-compliance.html#dfn-ill-formed">不適格</a> (<a class="cpprefjp-defined-word" data-desc="処理系は規則違反に対してエラーメッセージや警告を出さないかもしれない" href="../implementation-compliance.html#dfn-no-diagnostic-required">診断不要</a>) に変更</td>
448448
</tr>
449449
<tr>
450-
<td><span href="https://cpprefjp.github.io/lang/cpp26/line_is_not_in_line_with_existing_implementation.md.nolink"><code>#line</code>ディレクティブの制約を現実の実装に合わせて緩和する</span></td>
450+
<td><a href="cpp26/line_is_not_in_line_with_existing_implementation.html"><code>#line</code>ディレクティブの制約を現実の実装に合わせて緩和する</a></td>
451451
<td><code>#line 0</code><code>#line 2147483648</code>のような行番号指定を<a class="cpprefjp-defined-word" data-desc="プログラムが適格でないこと。コンパイルエラーなどになる" href="../implementation-compliance.html#dfn-ill-formed">不適格</a>としていたが、条件付きサポートとして許可する</td>
452452
</tr>
453453
</tbody>
Lines changed: 268 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,268 @@
1+
<!doctype html>
2+
<html class="cpprefjp" lang="ja" itemscope="" itemtype="http://schema.org/WebPage">
3+
<head>
4+
5+
6+
<!-- Google tag (gtag.js) -->
7+
<script async src="https://www.googletagmanager.com/gtag/js?id=G-NXNBNVBTJS"></script>
8+
<script>
9+
window.dataLayer = window.dataLayer || [];
10+
function gtag(){dataLayer.push(arguments);}
11+
gtag('js', new Date());
12+
13+
gtag('config', 'G-NXNBNVBTJS');
14+
</script>
15+
16+
17+
<meta charset="UTF-8">
18+
19+
<title>#lineディレクティブの制約を現実の実装に合わせて緩和する [P4136R2] - cpprefjp C++日本語リファレンス</title>
20+
21+
<meta name="viewport" content="width=device-width,initial-scale=1">
22+
<meta name="keywords" content="
23+
C++,標準ライブラリ,リファレンス,ドキュメント,STL,std,cpp26
24+
">
25+
<meta name="title" content="#lineディレクティブの制約を現実の実装に合わせて緩和する [P4136R2] - cpprefjp C++日本語リファレンス" />
26+
<meta itemprop="name" content="#lineディレクティブの制約を現実の実装に合わせて緩和する [P4136R2] - cpprefjp C++日本語リファレンス" />
27+
<meta property="og:title" content="#lineディレクティブの制約を現実の実装に合わせて緩和する [P4136R2] - cpprefjp C++日本語リファレンス" />
28+
<meta property="og:url" content="https://cpprefjp.github.io/lang/cpp26/line_is_not_in_line_with_existing_implementation.html" />
29+
<meta property="og:site_name" content="cpprefjp - C++日本語リファレンス" />
30+
<meta property="og:type" content="article" />
31+
<meta property="og:description" content="`#line`ディレクティブは、後続のソース行の行番号を指定する。" />
32+
<meta name="twitter:card" content="summary" />
33+
<meta name="twitter:title" content="#lineディレクティブの制約を現実の実装に合わせて緩和する [P4136R2] - cpprefjp C++日本語リファレンス" />
34+
<meta name="twitter:url" content="https://cpprefjp.github.io/lang/cpp26/line_is_not_in_line_with_existing_implementation.html" />
35+
<meta name="twitter:description" content="`#line`ディレクティブは、後続のソース行の行番号を指定する。" />
36+
37+
38+
<link rel="alternate" type="application/atom+xml" title="Atom" href="https://cpprefjp.github.io/rss.xml" />
39+
40+
41+
<link rel="apple-touch-icon" sizes="180x180" href="../../static/favicons/apple-touch-icon.png?cachebust=b2142794d8ca9924d883222f0df04f8c964ce722">
42+
<link rel="icon" type="image/png" sizes="32x32" href="../../static/favicons/favicon-32x32.png?cachebust=b2142794d8ca9924d883222f0df04f8c964ce722">
43+
<link rel="icon" type="image/png" sizes="16x16" href="../../static/favicons/favicon-16x16.png?cachebust=b2142794d8ca9924d883222f0df04f8c964ce722">
44+
<link rel="manifest" href="../../manifest.json?cachebust=b2142794d8ca9924d883222f0df04f8c964ce722">
45+
<meta name="theme-color" content="#f5f8fc">
46+
47+
<link rel="stylesheet" href="../../static/pygments/default.css?cachebust=b2142794d8ca9924d883222f0df04f8c964ce722">
48+
<!-- <link rel="stylesheet" href="../../static/css/root.css"> -->
49+
50+
51+
52+
53+
54+
<link href="../../static/kunai/css/kunai-stage-0.css?cachebust=b2142794d8ca9924d883222f0df04f8c964ce722" rel="stylesheet">
55+
<link href="../../static/kunai/css/kunai-stage-1.css?cachebust=b2142794d8ca9924d883222f0df04f8c964ce722" rel="stylesheet">
56+
<link href="../../static/kunai/css/kunai-stage-2.css?cachebust=b2142794d8ca9924d883222f0df04f8c964ce722" rel="stylesheet">
57+
<link href="../../static/kunai/css/kunai-stage-3.css?cachebust=b2142794d8ca9924d883222f0df04f8c964ce722" rel="stylesheet">
58+
59+
<script type="text/javascript" src="../../static/kunai/js/kunai-vendor.js?cachebust=b2142794d8ca9924d883222f0df04f8c964ce722"></script>
60+
<script type="text/javascript" src="../../static/kunai/js/kunai.js?cachebust=b2142794d8ca9924d883222f0df04f8c964ce722"></script>
61+
62+
<script type="text/javascript">
63+
document.addEventListener('DOMContentLoaded', function() {
64+
var kn = new Kunai;
65+
kn.cpprefjp();
66+
});
67+
</script>
68+
69+
</head>
70+
<body>
71+
<header data-kunai-mdinfo="{&#34;meta&#34;: {&#34;cpp&#34;: [&#34;cpp26&#34;]}, &#34;sources&#34;: [], &#34;page_id&#34;: [&#34;lang&#34;, &#34;cpp26&#34;, &#34;line_is_not_in_line_with_existing_implementation&#34;]}">
72+
<nav class="navbar navbar-default" role="navigation">
73+
<div class="container-fluid">
74+
<div class="navbar-header">
75+
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse">
76+
<span class="sr-only">Toggle navigation</span>
77+
<span class="icon-bar"></span>
78+
<span class="icon-bar"></span>
79+
<span class="icon-bar"></span>
80+
</button>
81+
<a class="navbar-brand" href="../../index.html">
82+
<div class="title-wrapper clearfix">
83+
<div class="title">cpprefjp - C++日本語リファレンス</div>
84+
</div>
85+
</a>
86+
</div>
87+
88+
<div class="collapse navbar-collapse" id="navbar-collapse">
89+
<ul class="nav navbar-nav navbar-right">
90+
<li>
91+
<div class="google-search">
92+
93+
94+
<script>
95+
(function() {
96+
var cx = '013316413321391058734:ji_u66hl7hq';
97+
var gcse = document.createElement('script');
98+
gcse.type = 'text/javascript';
99+
gcse.async = true;
100+
gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
101+
'//www.google.com/cse/cse.js?cx=' + cx;
102+
var s = document.getElementsByTagName('script')[0];
103+
s.parentNode.insertBefore(gcse, s);
104+
})();
105+
</script>
106+
<div class="gcse-search"></div>
107+
108+
109+
</div>
110+
</li>
111+
<li>
112+
<a href="https://github.com/cpprefjp/site">GitHub Project</a>
113+
</li>
114+
</ul>
115+
</div>
116+
</div>
117+
</nav>
118+
</header>
119+
120+
<main id="main" role="main">
121+
<div class="container-fluid">
122+
<div class="row">
123+
<div class="col-sm-9 col-sm-push-3" itemscope itemtype="http://schema.org/Article">
124+
<div class="row">
125+
<div class="col-sm-12 google-search-result">
126+
<gcse:searchresults></gcse:searchresults>
127+
</div>
128+
</div>
129+
<div class="row">
130+
<div class="col-sm-12 content-header">
131+
132+
<ol class="breadcrumb">
133+
134+
<li itemscope itemtype="http://www.schema.org/SiteNavigationElement">
135+
<span>
136+
137+
<a href="../../index.html" itemprop="url">
138+
139+
<i class="fa fa-fw fa-home"></i>
140+
141+
</a>
142+
143+
</span>
144+
</li>
145+
146+
<li itemscope itemtype="http://www.schema.org/SiteNavigationElement">
147+
<span>
148+
149+
<a href="../../lang.html" itemprop="url">
150+
151+
<span itemprop="name">言語機能</span>
152+
153+
</a>
154+
155+
</span>
156+
</li>
157+
158+
<li itemscope itemtype="http://www.schema.org/SiteNavigationElement">
159+
<span>
160+
161+
<a href="../../lang/cpp26.html" itemprop="url">
162+
163+
<span itemprop="name">C++26</span>
164+
165+
</a>
166+
167+
</span>
168+
</li>
169+
170+
<li class="active" itemscope itemtype="http://www.schema.org/SiteNavigationElement">
171+
<span>
172+
173+
174+
<span itemprop="name">#lineディレクティブの制約を現実の実装に合わせて緩和する [P4136R2]</span>
175+
176+
177+
</span>
178+
</li>
179+
180+
</ol>
181+
<div class="crsearch"></div>
182+
183+
</div>
184+
</div>
185+
<div class="row">
186+
<div class="col-sm-12 edit-button">
187+
188+
189+
<p class="text-right"><small>
190+
最終更新日時(UTC):
191+
<span itemprop="datePublished" content="2026-06-25T06:15:02">
192+
2026年06月25日 06時15分02秒
193+
</span>
194+
<br/>
195+
<span itemprop="author" itemscope itemtype="http://schema.org/Person">
196+
<span itemprop="name">Akira Takahashi</span>
197+
</span>
198+
が更新
199+
</small></p>
200+
201+
202+
<p class="text-right">
203+
<a class="history" target="_blank" href="https://github.com/cpprefjp/site/commits/master/lang/cpp26/line_is_not_in_line_with_existing_implementation.md">
204+
<span class="fa fa-fw fa-clock-o fa-flip-horizontal"></span>履歴
205+
</a>
206+
<a class="edit" target="_blank" href="https://github.com/cpprefjp/site/edit/master/lang/cpp26/line_is_not_in_line_with_existing_implementation.md">
207+
<span class="fa fa-fw fa-pencil"></span>編集
208+
</a>
209+
</p>
210+
</div>
211+
</div>
212+
<div class="row">
213+
<div class="col-sm-12 content-body">
214+
215+
<h1 itemprop="name"><span class="token"><code>#line</code>ディレクティブの制約を現実の実装に合わせて緩和する [P4136R2]</span><span class="cpp cpp26" title="C++26で追加">(C++26)</span></h1>
216+
<div itemprop="articleBody"><p>
217+
</p>
218+
<p>このページはC++26に採用される見込みの言語機能の変更を解説しています。</p>
219+
<p>のちのC++規格でさらに変更される場合があるため<a href="#relative-page">関連項目</a>を参照してください。</p>
220+
<p>
221+
</p>
222+
<h2>概要</h2>
223+
<p><code>#line</code>ディレクティブは、後続のソース行の行番号を指定する。</p>
224+
<p><div class="codehilite"><pre><span></span><code><span class="cp">#line 100 "foo.cpp"</span>
225+
<span class="c1">// 以降の行は、ファイル名"foo.cpp"の100行目から始まるものとして扱われる</span>
226+
</code></pre></div>
227+
</p>
228+
<p>C++26より前までは、行番号として<code>0</code>もしくは<code>2147483647</code>より大きい値を指定することが<a class="cpprefjp-defined-word" data-desc="プログラムが適格でないこと。コンパイルエラーなどになる" href="../../implementation-compliance.html#dfn-ill-formed">不適格</a>と規定されていたが、これは現実の実装の振る舞いと合致していなかった。</p>
229+
<p>C++26では、<code>[1, 2147483647]</code>の範囲外の行番号指定を、<a class="cpprefjp-defined-word" data-desc="プログラムが適格でないこと。コンパイルエラーなどになる" href="../../implementation-compliance.html#dfn-ill-formed">不適格</a>ではなく「条件付きサポート (conditionally-supported)」とする。条件付きサポートとは、その指定を実装がサポートするかどうかが<a class="cpprefjp-defined-word" data-desc="処理系定義の動作。処理系によって事前に定めた動作をする" href="../../implementation-compliance.html#dfn-implementation-defined-behavior">実装定義</a>であり、サポートしない場合は診断 (コンパイルエラー) が必要となる、ことを意味する。</p>
230+
<p><div class="codehilite"><pre><span></span><code><span class="cp">#line 0 </span><span class="c1">// 条件付きサポート (C++26より前では不適格)</span>
231+
<span class="cp">#line 2147483648 </span><span class="c1">// 条件付きサポート (C++26より前では不適格)</span>
232+
</code></pre></div>
233+
</p>
234+
<p>現実のコンパイラ実装の動作に合わせ、そのような仕様とする。</p>
235+
<h2><a href="#relative-page" id="relative-page">関連項目</a></h2>
236+
<ul>
237+
<li><a href="preprocessing_is_never_undefined.html">C++26 プリプロセッサ仕様での「未定義動作」を不適格 (診断不要) に変更</a></li>
238+
<li><a href="allow_line_before_module_declarations.html">C++26 モジュール宣言より前での<code>#line</code>ディレクティブの使用を許可する</a></li>
239+
</ul>
240+
<h2>参照</h2>
241+
<ul>
242+
<li><a href="https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2843r3.pdf" target="_blank">P2843R3 Preprocessing is never undefined</a></li>
243+
<li><a href="https://open-std.org/jtc1/sc22/wg21/docs/papers/2026/p4136r2.pdf" target="_blank">P4136R2 <code>#line</code> is not in line with existing implementation</a></li>
244+
</ul></div>
245+
246+
</div>
247+
</div>
248+
</div>
249+
250+
251+
<div id="sidebar" class="col-sm-3 col-sm-pull-9">
252+
</div>
253+
254+
255+
</div>
256+
</div>
257+
</main>
258+
<footer class="footer navbar navbar-default">
259+
<div class="container-fluid">
260+
<p><small>
261+
本サイトの情報は、
262+
<a href="https://creativecommons.org/licenses/by/4.0/deed.ja" rel="nofollow">クリエイティブ・コモンズ 表示 4.0 非移植 ライセンス(CC BY)</a>
263+
の下に提供されています。
264+
</small></p>
265+
</div>
266+
</footer>
267+
</body>
268+
</html>

lang/cpp26/preprocessing_is_never_undefined.html

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,8 @@
188188

189189
<p class="text-right"><small>
190190
最終更新日時(UTC):
191-
<span itemprop="datePublished" content="2026-04-07T07:14:17">
192-
2026年04月07日 07時14分17秒
191+
<span itemprop="datePublished" content="2026-06-25T06:15:02">
192+
2026年06月25日 06時15分02秒
193193
</span>
194194
<br/>
195195
<span itemprop="author" itemscope itemtype="http://schema.org/Person">
@@ -260,9 +260,9 @@ <h2>変更の対象</h2>
260260
<td><a class="cpprefjp-defined-word" data-desc="プログラムが適格でないこと。コンパイルエラーなどになる" href="../../implementation-compliance.html#dfn-ill-formed">不適格</a> (<a class="cpprefjp-defined-word" data-desc="処理系は規則違反に対してエラーメッセージや警告を出さないかもしれない" href="../../implementation-compliance.html#dfn-no-diagnostic-required">診断不要</a>)</td>
261261
</tr>
262262
<tr>
263-
<td><code>#line</code>ディレクティブの不正な値 (0や2147483647超)</td>
263+
<td><code>#line</code>ディレクティブの範囲外の値 (0や2147483647超)</td>
264264
<td><a class="cpprefjp-defined-word" data-desc="未定義の動作。処理系は予期せぬ動作をする可能性がある。要するに動作保証対象外。undefined behavior (UB)。" href="../../implementation-compliance.html#dfn-undefined-behavior">未定義動作</a></td>
265-
<td><a class="cpprefjp-defined-word" data-desc="プログラムが適格でないこと。コンパイルエラーなどになる" href="../../implementation-compliance.html#dfn-ill-formed">不適格</a></td>
265+
<td><a href="line_is_not_in_line_with_existing_implementation.html">条件付きサポート</a></td>
266266
</tr>
267267
<tr>
268268
<td>定義済みマクロ名の<code>#define</code>/<code>#undef</code></td>
@@ -280,6 +280,10 @@ <h2>変更の対象</h2>
280280
<h2>参照</h2>
281281
<ul>
282282
<li><a href="https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2843r3.pdf" target="_blank">P2843R3 Preprocessing is never undefined</a></li>
283+
<li><a href="https://open-std.org/jtc1/sc22/wg21/docs/papers/2026/p4136r2.pdf" target="_blank">P4136R2 <code>#line</code> is not in line with existing implementation</a><ul>
284+
<li>本提案で<a class="cpprefjp-defined-word" data-desc="プログラムが適格でないこと。コンパイルエラーなどになる" href="../../implementation-compliance.html#dfn-ill-formed">不適格</a>に変更した<code>#line</code>の範囲外の値を、条件付きサポートに緩和した</li>
285+
</ul>
286+
</li>
283287
</ul></div>
284288

285289
</div>

0 commit comments

Comments
 (0)