-
Details
Diff Detail
Event Timeline
clang/lib/StaticAnalyzer/Core/CallEvent.cpp | ||
---|---|---|
384 | dyn_cast, whoops. |
clang/unittests/StaticAnalyzer/CallDescriptionTest.cpp | ||
---|---|---|
176 | Weird formatting. |
This is very handy, thank you!
clang/lib/StaticAnalyzer/Core/CallEvent.cpp | ||
---|---|---|
388–391 | In any case, i'd prefer ND->getNameAsString() here. | |
clang/unittests/StaticAnalyzer/CallDescriptionTest.cpp | ||
175 | Let's also test {"std", "basic_string", "basic_string"}. | |
214 | What do you think about having a constructor override for CallDescription that accepts an OverloadedOperatorKind? That'll be faster and more type-safe than matching operator name as string. |
- Refactor.
clang/lib/StaticAnalyzer/Core/CallEvent.cpp | ||
---|---|---|
388–391 | +1, but the API is that smart: assert(Name.isIdentifier() && "Name is not a simple identifier");. However, we have ND->getDeclName().getAsString() which is equivalent to dumping to the stream (literally) and handles unnamed declarations, my bad. I have learnt from @aaron.ballman dumping to a stream is safe and I believed this is the only solution. @aaron.ballman, what if we introduce getNameMayUnnamed() for convenient use? It would immediately ring the bells to use the right API. | |
clang/unittests/StaticAnalyzer/CallDescriptionTest.cpp | ||
214 | Great idea, thanks! Added in: D81059 |
clang/lib/StaticAnalyzer/Core/CallEvent.cpp | ||
---|---|---|
388–391 |
It's in getName(), not in getNameAsString(). The latter always succeeds. |
clang/lib/StaticAnalyzer/Core/CallEvent.cpp | ||
---|---|---|
388–391 | Hm, I have miss read the API, whoops. It is being deprecated 11 years ago and I have believed it delegates the work on getName(). Also @aaron.ballman believed Out << *ND is so cool, meanwhile it is the same as getNameAsString(). So much mystery around that API, facepalm. Thanks! |
Why did you suddenly want to remove this cast? CXXConstructorDecl is still a FunctionDecl.
Wait, why do we even need a patch for this? Didn't it already work out of the box previously?