[llvm-bugs] [Bug 45204] New: concepts: constrained member functions illegally instantiated during explicit class template instantiation

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Mar 14 08:36:59 PDT 2020


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

            Bug ID: 45204
           Summary: concepts: constrained member functions illegally
                    instantiated during explicit class template
                    instantiation
           Product: clang
           Version: 10.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++2a
          Assignee: unassignedclangbugs at nondot.org
          Reporter: akrzemi1 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

The following correct C++20 program fails to compile in clang.

```
template <typename T>
concept has_a = requires(T v) { v.a(); };

template<typename T>
struct X
{
  void fun(T) {}
  void gun(T v) requires has_a<T> { v.a(); }
};

template struct X<int>; 
```
member function `gun()` is instantiated which is a bug according to
http://eel.is/c++draft/temp.explicit#11


This works in the old experimental implementation of concepts in Clang by Saar
Raz: https://godbolt.org/z/K4SaCm

-- 
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/20200314/0904d428/attachment.html>


More information about the llvm-bugs mailing list