<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/103475>103475</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Method Constraints with Full Specialization Fails to Link (Undefined Symbols)
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
jcsq6
</td>
</tr>
</table>
<pre>
Please refer to [this](https://github.com/llvm/llvm-project/issues/102548) previous issue I posted, as the problem is very related. This issue was resolved, as it appeared to be fixed in the most recent clang version. However, it is still causing problems with the linker.
I can only assume that the problem stems from how the symbols are named by clang, and that the full specialization of a method with constraints is being named inconsistently between the declaration and implementation.
This inconsistency also appears to only present itself in between different translation units.
Minimal example of failure:
To compile:
`clang++ -std=c++20 -c fail.cpp -o fail.o`
`clang++ -std=c++20 fail.o main.cpp`
**fail.h**
```
#pragma once
#include <concepts>
template <typename T>
struct test
{
void method() requires(std::floating_point<T>);
};
```
**fail.cpp**
```
#include "fail.h"
#include <iostream>
template <>
void test<double>::method()
{
std::cout << "Sucess\n";
}
```
**main.cpp**
```
#include <iostream>
#include "fail.h"
int main()
{
test<double> t;
t.method();
}
```
This compiles and links in gcc, but fails to compile using clang.
```
clang++ --version
clang version 20.0.0git (https://github.com/llvm/llvm-project.git 101cf540e698529d3dd899d00111bcb654a3c12b)
Target: arm64-apple-darwin23.5.0
Thread model: posix
InstalledDir: /usr/local/bin
```
PS: Although I wasn't able to replicate this by adding "-g" to this minimal example, this problem only presented itself in the release build of my project.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJykVt2u2zYMfhrlhohhy3ESX-TinKTBCqxAgdNdD7JEx2plyZXopNnTD5Lzc9J1px0GBI4tkp_IT_yRCEEfLOKGVc-s2s3ESJ3zm88yfF3OGqfOm48GRUDw2KIHcsCqZ-p0YNWO8XVHNARWPjG-Z3x_0NSNTSZdz_jemOP1bz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