extract: namespaced C++ this->m and parameter p->m accesses file under different container types

オープン
#198 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
55/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
cpp, rust
領域
backend, devtools

調査の方向性

Start by reading commit dbb20a0 and trace how semcode records C++ member accesses for this and parameter types, especially namespace resolution. The issue does not name source files or tests, so locate the relevant extractor code and existing C++ access tests first. Done means both accesses resolve to outer::Box and a regression test confirms querying outer::Box::m returns both.

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

説明

Inside a C++ namespace, member data accesses through this and through a parameter of the same class are recorded under different container_type keys, so a single accesses query misses half the accesses.

Reproducer

namespace outer {
struct Box { int m; void touch(); };
void Box::touch() { this->m = 1; }
void g(Box *p) { p->m = 2; }
}
  • this->m in Box::touch is recorded with container_type = Some("outer::Box").
  • p->m in g is recorded with container_type = Some("Box") (the spelling written in the parameter list).

Cause

Documented in dbb20a0: this takes the enclosing owner's full namespace-qualified path, while parameter types are recorded as written without namespace qualification.

Expected behavior

Both this->m and p->m inside namespace outer should resolve to the same container (outer::Box) so querying outer::Box::m returns both accesses.

主要言語
Rust
スター
187
フォーク
53
平均マージ
1日 9時間
マージ済み PR(30日)
79

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

facebookexperimental/semcode のほかの issue

facebookexperimental/semcode の issue をすべて見る

似ている issue

Rust の issue をもっと見る

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

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