| Issue |
60979
|
| Summary |
[clang] operator< parsed as template
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
tJener
|
The following fails to compile in clang unless there are parentheses around `s.bazinga`. `gcc` appears to accept this. Who is correct?
```c++
template <typename T>
struct bazinga {};
template <typename T>
struct Foo {
struct S { int bazinga; };
bool Bar(const S& s, int x) const {
return s.bazinga < x;
}
};
```
```
<source>:9:25: error: expected '>'
return s.bazinga < x;
^
<source>:9:22: note: to match this '<'
return s.bazinga < x;
^
<source>:9:25: error: expected unqualified-id
return s.bazinga < x;
^
2 errors generated.
```
Compiler Explorer: https://godbolt.org/z/oj86T3Taq
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs