[llvm-bugs] [Bug 52366] New: Wrong processing of substitution failure in an atomic constraint of template function requires-clause

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Oct 30 10:25:28 PDT 2021


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

            Bug ID: 52366
           Summary: Wrong processing of substitution failure in an atomic
                    constraint of template function requires-clause
           Product: clang
           Version: 13.0
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++2a
          Assignee: unassignedclangbugs at nondot.org
          Reporter: fchelnokov at gmail.com
                CC: blitzrakete at gmail.com, erik.pilkington at gmail.com,
                    llvm-bugs at lists.llvm.org, richard-llvm at metafoo.co.uk

Below code is valid, because sizeof(int)>0:
```
template<class T, class U>
void g() requires(sizeof(T)>0 || sizeof(U)>0) {}

int main() { 
    g<void,int>(); //error in Clang
}
```
It is accepted by GCC, but unfortunately not by Clang. Demo:
https://gcc.godbolt.org/z/P69beYhqY

Related discussion: https://stackoverflow.com/q/69173117/7325599

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20211030/ab33cebf/attachment.html>


More information about the llvm-bugs mailing list