[all-commits] [llvm/llvm-project] 427284: [clang][deps] Don't treat ObjC method args as modu...

Michael Spencer via All-commits all-commits at lists.llvm.org
Thu Jul 18 13:37:23 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4272847546225bcf2e83e09e3a620bf286c058fd
      https://github.com/llvm/llvm-project/commit/4272847546225bcf2e83e09e3a620bf286c058fd
  Author: Michael Spencer <bigcheesegs at gmail.com>
  Date:   2024-07-18 (Thu, 18 Jul 2024)

  Changed paths:
    M clang/lib/Lex/DependencyDirectivesScanner.cpp
    M clang/unittests/Lex/DependencyDirectivesScannerTest.cpp

  Log Message:
  -----------
  [clang][deps] Don't treat ObjC method args as module directives (#97654)

`import:(type)name` is a method argument decl in ObjC, but the C++20
preprocessing rules say this is a preprocessing line.

Because the dependency directive scanner is not language dependent, this
patch extends the C++20 rule to exclude `module :` (which is never a
valid module decl anyway), and `import :` that is not followed by an
identifier.

This is ok to do because in C++20 mode the compiler will later error on
lines like this anyway, and the dependencies the scanner returns are
still correct.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list