diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index 193fa5bbb4d..10f80153477 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -2998,6 +2998,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 88c83eba4b1..83fec2469af 100644 --- a/test/testother.cpp +++ b/test/testother.cpp @@ -4763,6 +4763,12 @@ class TestOther : public TestFixture { " return [](int* p) { return *p; }(&i);\n" "}\n"); ASSERT_EQUALS("[test.cpp:3:20]: (style) Parameter 'p' 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() {