<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/65802>65802</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Clang++: Template specialization doesn't work with function attributes
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          gaaclarke
      </td>
    </tr>
</table>

<pre>
    ## Minimal reproduction
```c++
#include <type_traits>

#define VKAPI_ATTR __attribute__((pcs("aapcs-vfp")))

VKAPI_ATTR void function1(int a, double b) {
  // ...
}

VKAPI_ATTR void function2(int a, double b) {
  // ...
}

template <typename T, typename U>
struct CheckSameSignature : std::false_type {};

template <typename Ret, typename... Args>
struct CheckSameSignature<Ret(Args...), Ret(Args...)> : std::true_type {};

static_assert(
    CheckSameSignature<decltype(function1), decltype(function2)>::value,
    "Functions have different signatures");

int main() { return 0; }
```

godbolt: https://godbolt.org/z/v5rafYo55

## clang version

armv7-a clang 11.0.1

## observed behavior

The `static_assert` fails saying the signatures are not the same, just as they are if you remove the attributes.

## expected behavior

I expect these signatures to be considered the same.

## error output

```
error: static_assert failed due to requirement 'CheckSameSignature<void (int, double) __attribute__((pcs("aapcs-vfp"))), void (int, double) __attribute__((pcs("aapcs-vfp")))>::value' "Functions have different signatures"armv7-a clang 11.0.1 #1
```

## description

I'm not 100% sure this isn't some oddity with the c++ spec and not a failure specialize correctly.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysVU2P2zYQ_TX0ZbACNbIt-6CD1xsDi6JAkWwL9GRQ4shiVhJVcqTU-fUFZdlrb90kRQsI_iCHbx7fvBkp782hJcrE4lEsnmaq58q67KBUUSv3SrPc6mMmMBGYwM-mNY2qwVHnrO4LNrYV8knIjVjK01MIfAzPaRUT0xZ1rwlEsuVjR3t2yrAXyYcp4hynqTQtwW8_bX553m9eXj7Cfq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