Make it more ergonomic to get the initializer of a variable declaration in C++
オープン
C++
question
- 主要言語
- CodeQL
- スター
- 10.1k
- フォーク
- 2.1k
- 平均マージ
- 2日 15時間
- マージ済み PR(30日)
- 141
説明
I would expect that if I have a `DeclStmt` or a `DeclarationEntry`, I should be able to directly get the `Initializer`s corresponding to those entries, if they exist. I don't see a way to directly do that, and currently I have to resort to this:
```codeql
Initializer getDeclStmtInitializer(DeclStmt ds) {
result.getDeclaration().getADeclarationEntry() = ds.getADeclarationEntry()
}
```
Could we add some methods into the standard library classes (i.e. `DeclStmt::getAnInitializer`, `Declaration::getAnInitializer` `DeclarationEntry::getInitializer()`, etc.), to make it easier to get variable declaration initializers so we don't have to resort to these types of helper functions?
コントリビューションガイド
評価
この issue はまだ評価されていません。