https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94117

            Bug ID: 94117
           Summary: non-dependent expr treated as-if dependent
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: nathan at gcc dot gnu.org
  Target Milestone: ---

Created attachment 48006
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48006&action=edit
distilled from ranges

We accept the attached test case, which should be rejected.
It comes from these two fragments of the ranges header:

lines ~1595
          static constexpr decltype(auto)
          __iter_move(const _Iterator& __i = {})
            noexcept(noexcept(std::__invoke(*__i._M_parent->_M_fun,
                                            *__i._M_current)))
          {
            if constexpr (is_lvalue_reference_v<decltype(*__i)>)
              return std::move(*__i);
            else
              return *__i;
          }

lines ~1752
          friend constexpr decltype(auto)
          iter_move(const _Iterator& __i) noexcept(noexcept(__iter_move()))
          { return __iter_move(__i); }

If we change __iter_move's argument type to int, we reject complaining that the
call in iter_move's noexcept spec requires the default argument before it's
been parsed.  Clang rejects either way.

the '__iter_move ()' call is not dependent because it has no arguments. 
Addition of the default argument does not make it dependent.

filing a separate issue to fix libstdc++

Reply via email to