Index: clang/include/clang/Basic/DiagnosticSemaKinds.td =================================================================== --- clang/include/clang/Basic/DiagnosticSemaKinds.td +++ clang/include/clang/Basic/DiagnosticSemaKinds.td @@ -6781,7 +6781,7 @@ "taking address of packed member %0 of class or structure %q1 may result in an unaligned pointer value">, InGroup>; def warn_param_mismatched_alignment : Warning< - "passing %0-byte aligned argument to %1-byte aligned parameter %2 of %3 may result in an unaligned pointer access">, + "passing %0-byte aligned argument to %1-byte aligned parameter %2%select{| of %4}3 may result in an unaligned pointer access">, InGroup>; def err_objc_object_assignment : Error< Index: clang/lib/Sema/SemaChecking.cpp =================================================================== --- clang/lib/Sema/SemaChecking.cpp +++ clang/lib/Sema/SemaChecking.cpp @@ -4956,7 +4956,7 @@ if (ArgAlign < ParamAlign) Diag(Loc, diag::warn_param_mismatched_alignment) << (int)ArgAlign.getQuantity() << (int)ParamAlign.getQuantity() - << ParamName << FDecl; + << ParamName << (FDecl != nullptr) << FDecl; } /// Handles the checks for format strings, non-POD arguments to vararg Index: clang/test/CodeGen/typedef_alignment_mismatch_warning.cpp =================================================================== --- clang/test/CodeGen/typedef_alignment_mismatch_warning.cpp +++ clang/test/CodeGen/typedef_alignment_mismatch_warning.cpp @@ -282,3 +282,7 @@ auto *UA4ptr = new UsingAligned4(11); new (UA4ptr) UsingAligned4(12); } + +void testFunctionPointerArray(void (*fptr[10])(Aligned8Int *), Aligned2Int* src) { + fptr[0](src); // expected-warning {{passing 2-byte aligned argument to 8-byte aligned parameter 1 may result in an unaligned pointer access}} +}