[prev in list] [next in list] [prev in thread] [next in thread] 

List:       llvm-bugs
Subject:    [llvm-bugs] [Bug 50934] New: Address of function template in concept should cause concept to evaluat
From:       via llvm-bugs <llvm-bugs () lists ! llvm ! org>
Date:       2021-06-29 20:55:14
Message-ID: bug-50934-206 () http ! bugs ! llvm ! org/
[Download RAW message or body]

--1625000115.a61e50121.8947
Date: Tue, 29 Jun 2021 13:55:15 -0700
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://bugs.llvm.org/
Auto-Submitted: auto-generated

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

            Bug ID: 50934
           Summary: Address of function template in concept should cause
                    concept to evaluate to false
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++2a
          Assignee: unassignedclangbugs@nondot.org
          Reporter: davidfromonline@gmail.com
                CC: blitzrakete@gmail.com, erik.pilkington@gmail.com,
                    llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk

The following valid translation unit

```
template<typename T>
concept foo = requires {
        &T::f;
};

struct S {
        template<typename T>
        void f(T);
};

static_assert(!foo<S>);
```

Is incorrectly rejected by clang with the error message

```
<source>:11:1: error: static_assert failed due to requirement '!foo<S>'
static_assert(!foo<S>);
^             ~~~~~~~
1 error generated.
Compiler returned: 1
```

See it live: https://godbolt.org/z/h7vTqo1Yb

-- 
You are receiving this mail because:
You are on the CC list for the bug.
--1625000115.a61e50121.8947
Date: Tue, 29 Jun 2021 13:55:15 -0700
MIME-Version: 1.0
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://bugs.llvm.org/
Auto-Submitted: auto-generated

<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Address of function template in concept should cause concept to \
evaluate to false"  href="https://bugs.llvm.org/show_bug.cgi?id=50934">50934</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Address of function template in concept should cause concept to \
evaluate to false  </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>C++2a
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs&#64;nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>davidfromonline&#64;gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>blitzrakete&#64;gmail.com, erik.pilkington&#64;gmail.com, \
llvm-bugs&#64;lists.llvm.org, richard-llvm&#64;metafoo.co.uk  </td>
        </tr></table>
      <p>
        <div>
        <pre>The following valid translation unit

```
template&lt;typename T&gt;
concept foo = requires {
        &amp;T::f;
};

struct S {
        template&lt;typename T&gt;
        void f(T);
};

static_assert(!foo&lt;S&gt;);
```

Is incorrectly rejected by clang with the error message

```
&lt;source&gt;:11:1: error: static_assert failed due to requirement '!foo&lt;S&gt;'
static_assert(!foo&lt;S&gt;);
^             ~~~~~~~
1 error generated.
Compiler returned: 1
```

See it live: <a href="https://godbolt.org/z/h7vTqo1Yb">https://godbolt.org/z/h7vTqo1Yb</a></pre>
  </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>
--1625000115.a61e50121.8947--


[Attachment #3 (text/plain)]

_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic