https://bugs.llvm.org/show_bug.cgi?id=48140

            Bug ID: 48140
           Summary: Clang fails to parse "s.name < ..." comparison in
                    function template if variable template "name" is also
                    in scope
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
          Assignee: unassignedclangb...@nondot.org
          Reporter: lang.l...@ymail.com
                CC: llvm-bugs@lists.llvm.org, neeil...@live.com,
                    richard-l...@metafoo.co.uk

```
template<class T> constexpr int idx = 1;

template<class T> bool f(T t) { return t.idx < 0; };
```

produces

```
<source>:3:49: error: expected '>'
template<class T> bool f(T t) { return t.idx < 0; }
                                                ^
<source>:3:46: note: to match this '<'
template<class T> bool f(T t) { return t.idx < 0; }
                                             ^
```

Affects -std=c++{14,17,20} and versions 3.5 -- trunk.

Godbolt: https://godbolt.org/z/oj76Pq

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to