You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Const suggestion check: an alias of a deduced parameter type keeps the suggestion not checked #250
With --experimental-const-suggestion-check, a suggestion stays "not checked" when the parameter's type reaches a local through an alias of a deduced type, while the same code without the alias is checked:
intdirect(int* p)
{
decltype(p) q = p;
return *q;
}
intaliased(int* p)
{
using P = decltype(p);
P q = p;
return *q;
}
direct: checked in the analyzed files only.
aliased: not checked with Clang: the rewrite also changes the type of q (a.cpp:9).
The scope step (§5.6, D19) tells the written form from the deduced part, but it does not follow a typedef or an alias declaration whose type is itself deduced from a planned parameter (writtenForm in src/analysis/ConstSuggestionFacts.cpp), so q's type counts as written by the rewrite.
Effect: a suggestion that could be shown valid is kept as not checked. That is conservative; no verdict is wrong.
Activity