1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Bug 536268 - Find uses of overloaded operators when checking for unused symbols

Change-Id: I4445b62d4419ffa12d505bcc8265492c22f49bb6
This commit is contained in:
Nathan Ridge 2018-06-25 23:51:17 -04:00
parent 9b2a2c206d
commit fa50ca7bc0
2 changed files with 13 additions and 0 deletions

View file

@ -233,6 +233,7 @@ public class UnusedSymbolInFileScopeChecker extends AbstractIndexAstChecker {
ast.accept(new ASTVisitor() {
{
shouldVisitNames = true;
shouldVisitImplicitNames = true;
shouldVisitDeclarations = true;
}

View file

@ -346,4 +346,16 @@ public class UnusedSymbolInFileScopeCheckerTest extends CheckerTestCase {
loadCodeAndRunCpp(getAboveComment());
checkNoErrors();
}
// class S {};
// S operator+(S, S);
//
// int main() {
// S a, b;
// a + b;
// }
public void testOverloadedOperator_536268() throws Exception {
loadCodeAndRunCpp(getAboveComment());
checkNoErrors();
}
}