<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/68454>68454</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Very misleading diagnostic for template `>>` in C++03
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang:diagnostics
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
cjdb
</td>
</tr>
</table>
<pre>
The diagnostic for the code below is very misleading, and doesn't help diagnose the problem.
**Source:**
```cpp
template<class T, int N>
inline static const bool sized = sizeof(T) == N;
template<bool B = sized<int, 4>>
int f()
{
return B ? 0 : 1;
}
int main()
{
return f();
}
```
**Diagnostic:**
```
<source>:2:26: warning: variable templates are a C++14 extension [-Wc++14-extensions]
2 | inline static const bool sized = sizeof(T) == N;
| ^
<source>:2:1: warning: inline variables are a C++17 extension [-Wc++17-extensions]
2 | inline static const bool sized = sizeof(T) == N;
| ^
<source>:5:5: error: expected '(' for function-style cast or type construction
5 | int f()
| ~~~ ^
<source>:13:2: error: expected '>'
13 | }
| ^
<source>:4:24: note: to match this '<'
4 | template<bool B = sized<int, 4>>
| ^
<source>:13:2: error: expected ',' or '>' in template-parameter-list
13 | }
| ^
<source>:13:2: error: expected unqualified-id
```
**Resolution:** Change `4>>` to `4> >`
**Git hash:** 8f397e04e5ce87fb5ff99d6659ba959c22ea926c
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzEVU2T4yYQ_TX40mWXBPqwDjr4Y5zbHpKt5MxHy2ILgwJodieH-e0pZMmezJQzldpDXBKWQLzX7zXQPAR9togtKfekPK74GHvnW_lNiZVw6qX92iMozc_WhagldM5D7BGkUwgCjfsOOsAz-he46GCQK23PhB6AWwXKYbCE1hF6NMMCgxPA4J0weNmQ7Eiy3dzSdP3mRi-RsPl1Hqqy6yWH4doT8TIYHpGwgzQ8BPiaaLWN8IWwp-s32hptEULkKXbpbIggnDMQ9F-ogLDj9OQ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