<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 - Concepts with parameter pack not at end silently ignores errors when used"
   href="https://bugs.llvm.org/show_bug.cgi?id=48838">48838</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Concepts with parameter pack not at end silently ignores errors when used
          </td>
        </tr>

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

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

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

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

        <tr>
          <th>Severity</th>
          <td>normal
          </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@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>mital.vaja@googlemail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>blitzrakete@gmail.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=24407" name="attach_24407" title="Patch to reject concepts with parameter packs not at the end">attachment 24407</a> <a href="attachment.cgi?id=24407&action=edit" title="Patch to reject concepts with parameter packs not at the end">[details]</a></span>
Patch to reject concepts with parameter packs not at the end

There are no errors or warnings compiling the following with `clang++
-std=c++20 -fsyntax-only`:

    template<typename, typename..., typename = int>
    concept invalid = true;

    template<typename> requires invalid<int>
    no errors are printed
    ;

    static_assert(invalid<int> also here ;

    int main() {
        bool b;
        b = invalid<int> not just in declarations;
        return b;
    }


This happens because this assumption is violated with concepts:
<a href="https://github.com/llvm/llvm-project/blob/39239f9b5666bebb059fa562badeffb9f1c3afab/clang/lib/Sema/SemaTemplate.cpp#L5756-L5760">https://github.com/llvm/llvm-project/blob/39239f9b5666bebb059fa562badeffb9f1c3afab/clang/lib/Sema/SemaTemplate.cpp#L5756-L5760</a>
and no diagnosis is printed beforehand

I have attached a patch that makes concepts like `invalid` which have a
parameter pack not at the end an error.

There is currently no wording in the standard that makes these concepts
ill-formed (The current C++20 [temp.param]p14 only mentions "primary class
template, primary variable template, or alias template"), but I think this is
an oversight.</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>