Issue 60658
Summary [libc++][ranges] `views::drop` uses non-reserved identifiers `dist` and `clamped`
Labels new issue
Assignees
Reporter JMazurkiewicz
    Example:

```c++
#define dist
#define clamped
#include <ranges>
```

**Expected**: this program should compile
**Got**:
```console
In file included from <source>:3:
In file included from /opt/compiler-explorer/clang-trunk-20230210/bin/../include/c++/v1/ranges:353:
/opt/compiler-explorer/clang-trunk-20230210/bin/../include/c++/v1/__ranges/drop_view.h:258:17: error: expected unqualified-id
      auto dist = ranges::distance(__rng);
 ^
/opt/compiler-explorer/clang-trunk-20230210/bin/../include/c++/v1/__ranges/drop_view.h:259:20: error: expected unqualified-id
      auto clamped = std::min<_Dist>(dist, std::forward<_Np>(__n));
 ^
[...]
```

Compiler explorer: https://godbolt.org/z/TGKEa818f
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to