From bb5c185e7b804476170d338820d0d2fca0f7742f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludvig=20Gunne=20Lindstr=C3=B6m?= Date: Sun, 8 Mar 2026 12:43:12 +0100 Subject: [PATCH 1/2] Add test --- test/testother.cpp | 6 ++++++ 1 file changed, 6 insertions(+) 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() { From 7aa3306b3007acb6a4d8cc14c96401f850fc6ecf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludvig=20Gunne=20Lindstr=C3=B6m?= Date: Sun, 8 Mar 2026 12:38:51 +0100 Subject: [PATCH 2/2] Fix #14539 --- lib/tokenize.cpp | 3 +++ 1 file changed, 3 insertions(+) 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