boostorg / boostorg/preprocessor

Result of `BOOST_PP_ARRAY_ELEM` can't be included in vs2017 using `/experimental:preprocessor` option

オープン
#25 コメント 7 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
C++
スター
118
フォーク
76
PR マージ指標
30日以内にマージされた PR はありません

説明

The following code does not compile under VS2017 using `/experimental:preprocessor` option:

```cpp
#include
#include

#define FOO (1,())
#define BAR BOOST_PP_ARRAY_ELEM(0, FOO)

#define HOGE_1(x) x
#define HOGE_2(x) HOGE_1(x)
#define HOGE() HOGE_2(BAR)
#define PUYO_1(x) #x
#define PUYO_2(x) PUYO_1(x)
#define PUYO() PUYO_2(BAR)

#include BAR //C2006
#include HOGE() //C2006

int main(){
std::cout << PUYO() << std::endl;
return 0;
}
```
Both `#include BAR` and `#include HOGE()` directives result in C2006 error, yet, `PUYO` macro could successfully get the string literal formed by `BAR`.
Switching to vs2019 eliminates this issue.

This issue breaks the usage of `` in `

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

示されているマクロの例を VS2017 と `/experimental:preprocessor` で再現し、その後 `` と `` からの使用箇所を調査します。完了条件は、影響を受ける include ディレクティブが VS2017 でコンパイルでき、VS2019 で既存の動作が維持されることです。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
cpp
領域
compilers
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。