[clang] [Clang] Repair the function "rParenEndsCast" to make incorrect judgments in template variable cases (PR #120904)

Owen Pan via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 24 21:08:48 PST 2024


================
@@ -2474,6 +2480,11 @@ class AnnotatingParser {
           Current.getNextNonComment()->isOneOf(tok::comma, tok::r_brace)) {
         Current.setType(TT_StringInConcatenation);
       }
+    } else if (Style.isCpp() && Current.is(tok::kw_using)) {
+      if (Current.Next && Current.Next->Next && Current.Next->Next->Next) {
+        if (Current.Next->Next->Next->isTypeName(LangOpts))
----------------
owenca wrote:

IMO this is too simplistic to be very useful. See the general syntax [here](https://en.cppreference.com/w/cpp/language/type_alias). Also, this doesn't work at all if the `using` statement is in a header file.

https://github.com/llvm/llvm-project/pull/120904


More information about the cfe-commits mailing list