回答編集履歴
3
逆だった
test
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
|
4
4
|
|
5
|
-
[clang++ prog.cc -Wall -Wextra -std=c++2a
|
5
|
+
[clang++ prog.cc -Wall -Wextra -std=c++2a | Wandboxでコンパイル](https://wandbox.org/permlink/eiUaRBhCusA7dJFl)
|
6
6
|
|
7
7
|
|
8
8
|
|
@@ -10,7 +10,7 @@
|
|
10
10
|
|
11
11
|
|
12
12
|
|
13
|
-
[clang++ prog.cc -Wall -Wextra -std=c++2a | Wandboxでコンパイル](https://wandbox.org/permlink/oXGLracvaVcwGBSh)
|
13
|
+
[clang++ prog.cc -Wall -Wextra -std=c++2a -pedantic-errors | Wandboxでコンパイル](https://wandbox.org/permlink/oXGLracvaVcwGBSh)
|
14
14
|
|
15
15
|
|
16
16
|
|
2
Cを追加
test
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
|
4
4
|
|
5
|
-
[clang++ -Wall -Wextra -std=c++2a -pedantic-errors | Wandboxでコンパイル](https://wandbox.org/permlink/eiUaRBhCusA7dJFl)
|
5
|
+
[clang++ prog.cc -Wall -Wextra -std=c++2a -pedantic-errors | Wandboxでコンパイル](https://wandbox.org/permlink/eiUaRBhCusA7dJFl)
|
6
6
|
|
7
7
|
|
8
8
|
|
@@ -10,7 +10,7 @@
|
|
10
10
|
|
11
11
|
|
12
12
|
|
13
|
-
[clang++ -Wall -Wextra -std=c++2a | Wandboxでコンパイル](https://wandbox.org/permlink/oXGLracvaVcwGBSh)
|
13
|
+
[clang++ prog.cc -Wall -Wextra -std=c++2a | Wandboxでコンパイル](https://wandbox.org/permlink/oXGLracvaVcwGBSh)
|
14
14
|
|
15
15
|
|
16
16
|
|
@@ -19,3 +19,11 @@
|
|
19
19
|
|
20
20
|
|
21
21
|
言ってしまえ、現在制定段階のC++2aの規格としては間違った書き方ですが、Cの仕様に合わせてClangでは言語仕様を拡張してサポートしているが、GCCはしていないというただそれだけです。C++2aはまだ仕様として確定ではないので、CのようにOKとなる可能性はあります。
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
なおC11ならGCCでも厳密仕様で通ります。
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
[gcc prog.c -Wall -Wextra -std=c11 -pedantic-errors | Wandboxでコンパイル](https://wandbox.org/permlink/1qETw5Bf0kwG4UsH) (C用にちょっと書き換え)
|
1
先
test
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
fanaさんが張っているリンクにも書いていますが、ネストされた指示付き初期化子はCでは有効でもC++では無効です。
|
1
|
+
fanaさんが張っているリンク先(ノートの部分)にも書いていますが、ネストされた指示付き初期化子はCでは有効でもC++では無効です。
|
2
2
|
|
3
3
|
|
4
4
|
|