JonasToth added a comment.
What happens to pointers in a typedef (in the sense of `*` instead of `&`)?
================
Comment at: clang-tidy/utils/ExprMutationAnalyzer.cpp:51
const auto nonConstReferenceType = [] {
- return referenceType(pointee(unless(isConstQualified())));
+ return hasUnqualifiedDesugaredType(
+ referenceType(pointee(unless(isConstQualified()))));
----------------
Not directly related, but this matcher matches universal references, even
though they might result in a value. (one of the bugs lebedevri reported).
================
Comment at: unittests/clang-tidy/ExprMutationAnalyzerTest.cpp:171
+ AST = tooling::buildASTFromCode("typedef int& IntRef;"
+ "void g(IntRef); void f() { int x; g(x); }");
----------------
i think the following tests should be added as well
- `typedef const int& IntRef;`
- `template <typename T> using TemplateRef = T&`
It would be better to have at least one positive and negative test (with
`const` and without `const` in the typedef) for each of theses cases.
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D50953
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits