diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index 7bdba656374..0973d7c1731 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -3013,6 +3013,9 @@ bool Tokenizer::simplifyUsing() if (!usingEnd) continue; + for (Token *typeTok = start; typeTok != usingEnd; typeTok = typeTok->next()) + typeTok->isSimplifiedTypedef(true); + // Move struct defined in using out of using. // using T = struct t { }; => struct t { }; using T = struct t; // fixme: this doesn't handle attributes diff --git a/test/testother.cpp b/test/testother.cpp index 0c6828a0b63..9ad57103b8f 100644 --- a/test/testother.cpp +++ b/test/testother.cpp @@ -4787,6 +4787,12 @@ class TestOther : public TestFixture { " return h(s ? s->gnc() : 1);\n" "}\n"); ASSERT_EQUALS("[test.cpp:5:11]: (style) Parameter 's' can be declared as pointer to const [constParameterPointer]\n", errout_str()); + + check("using IntPtr = int *;\n" + "int* foo(IntPtr bar) {\n" + " return bar = 0;\n" + "}\n"); + ASSERT_EQUALS("", errout_str()); } void constArray() {