[llvm-bugs] [Bug 44674] New: SFINAE leaks through requires expression requirement

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Jan 26 17:47:57 PST 2020


            Bug ID: 44674
           Summary: SFINAE leaks through requires expression requirement
           Product: clang
           Version: 10.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++2a
          Assignee: unassignedclangbugs at nondot.org
          Reporter: cjdb.ns 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

Created attachment 23063
  --> https://bugs.llvm.org/attachment.cgi?id=23063&action=edit
Initial preprocessed file

# Description

[iterator.concept.contiguous] depends on `std::to_address`, which (correctly)
fails in the "minimal" repro below. Unfortunately, the requirement seems to
leak an instantiation error, instead of SFINAEing out the overload and the
concept evaluating as false.

# LLVM configuration

cmake -GNinja  ../llvm-project/llvm/                                           

# Sample code built with

-std=c++2a -stdlib=libc++ -save-temps

# "Minimal" repo

#include <memory>

struct dummy {};

struct iterator {
        using element_type = dummy;
        int* operator->() const;

template<typename I>
concept passing = requires(I const& i) {

static_assert(not passing<iterator>);

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/20200127/7416d472/attachment.html>

More information about the llvm-bugs mailing list