diff --git a/cpp/find_warnings.py b/cpp/find_warnings.py index 482cfe3..2bdcb67 100644 --- a/cpp/find_warnings.py +++ b/cpp/find_warnings.py @@ -249,7 +249,10 @@ def _add_reference(name, namespace): return name = file_use_node[1].normalized_filename if name in file_uses: - file_uses[name] |= USES_REFERENCE + if isinstance(file_use_node[0], ast.Typedef): + file_uses[name] |= USES_DECLARATION + else: + file_uses[name] |= USES_REFERENCE def _add_use(name, namespace): if isinstance(name, list): diff --git a/test/baz.h b/test/baz.h index 2750db6..46ec50a 100644 --- a/test/baz.h +++ b/test/baz.h @@ -1,3 +1,5 @@ #include "bar.h" +#include "typedef.h" void fct(Bar& bar); +void fct(Type& t); diff --git a/test/typedef.h b/test/typedef.h index abb287f..1d3646f 100644 --- a/test/typedef.h +++ b/test/typedef.h @@ -2,3 +2,4 @@ class Foo; class Bar; typedef Plain p; typedef Ref r; +typedef int Type;