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

            Bug ID: 49598
           Summary: Immediate function in requires-expression not found by
                    ADL
           Product: clang
           Version: trunk
          Hardware: PC
               URL: https://godbolt.org/z/8PaYaG
                OS: Linux
            Status: NEW
          Keywords: compile-fail
          Severity: enhancement
          Priority: P
         Component: C++2a
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected], [email protected],
                    [email protected]

See https://godbolt.org/z/8PaYaG.
```C++
struct A{};
template<auto V> consteval bool f() { return false; }
template<auto V> requires requires { g(&V); } consteval bool f() { return true;
}
consteval bool g(const A*);
static_assert(f<A{}>());
```
```
<source>:5:1: error: static_assert failed due to requirement 'f<A{}>()'
static_assert(f<A{}>());
^             ~~~~~~~~
1 error generated.
Compiler returned: 1
```

It works if `g` is `constexpr`.

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

Reply via email to