[PATCH] D128449: [clang] Introduce -Warray-parameter

Alexander Kornienko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 12 05:48:31 PDT 2022


alexfh added a comment.

Serge, this diagnostic doesn't handle non-type template parameters correctly in some cases. Here's an example derived from a real code: https://gcc.godbolt.org/z/cvP8od5c6

  template<int K>
  struct T {
    static void F(int a[8 * K]);
  };
  template<int K>
  void T<K>::F(int a[8 * K]) {}



  <source>:6:18: warning: argument 'a' of type 'int[8 * K]' with mismatched bound [-Warray-parameter]
  void T<K>::F(int a[8 * K]) {}
                   ^
  <source>:3:21: note: previously declared as 'int[8 * K]' here
    static void F(int a[8 * K]);
                      ^

Do you see an obvious fix? If not, please revert while investigating.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D128449/new/

https://reviews.llvm.org/D128449



More information about the cfe-commits mailing list