public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/111357] New: __integer_pack fails to work with values of dependent type convertible to integers
@ 2023-09-10  2:16 frankhb1989 at gmail dot com
  2023-09-10  3:33 ` [Bug c++/111357] " pinskia at gcc dot gnu.org
                   ` (14 more replies)
  0 siblings, 15 replies; 16+ messages in thread
From: frankhb1989 at gmail dot com @ 2023-09-10  2:16 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 111357
           Summary: __integer_pack fails to work with values of dependent
                    type convertible to integers
           Product: gcc
           Version: 13.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: frankhb1989 at gmail dot com
  Target Milestone: ---

Case:

#include <cstddef>
#include <type_traits>
#include <tuple>

using std::size_t;
#if __cpp_lib_integer_sequence >= 201304L
using std::index_sequence;
using std::make_index_sequence;
#else
template<size_t... V>
struct index_sequence
{};

template<class>
struct succ;

template<size_t... V>
struct succ<index_sequence<V...>>
{
        using type = index_sequence<V..., sizeof...(V)>;
};

template<size_t N>
struct iseq
{
        using type = typename succ<typename iseq<N - 1>::type>::type;
};

template<>
struct iseq<0>
{
        using type = index_sequence<>;
};

template<size_t N>
using make_index_sequence = typename iseq<N>::type;
#endif


template<size_t... V>
void g(index_sequence<V...>)
{}

template<typename T>
struct R
{
        using S = make_index_sequence<std::tuple_size<std::tuple<T>>{}>;

        R() noexcept(noexcept(g(S())))
        {}
};

int main()
{
        R<int>();
}


Output of x86-64 gcc 13.2 (Compiler #1)
<source>: In instantiation of 'R<T>::R() [with T = int]':
<source>:55:9:   required from here
<source>:49:33: error: argument to '__integer_pack' must be between 0 and
268435452
   49 |         R() noexcept(noexcept(g(S())))
      |                                 ^~~

This should work as -std=c++11 which uses a naive implementation of
make_index_sequence here.

I mark it as a libstdc++ bug of conformance for the case. The root cause seems
a bug of the implementation in the frontend, but I'm not that sure, because the
document of __integer_pack does not mention such cases explicitly. (The error
message here is obviously confusing, though.)

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug c++/111357] __integer_pack fails to work with values of dependent type convertible to integers
  2023-09-10  2:16 [Bug libstdc++/111357] New: __integer_pack fails to work with values of dependent type convertible to integers frankhb1989 at gmail dot com
@ 2023-09-10  3:33 ` pinskia at gcc dot gnu.org
  2023-09-10  3:52 ` [Bug c++/111357] __integer_pack fails to work with values of dependent type convertible to integers in noexcept context pinskia at gcc dot gnu.org
                   ` (13 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-09-10  3:33 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
The front-end does:
      hi = instantiate_non_dependent_expr (hi, complain);
      hi = cxx_constant_value (hi, complain);
      int len = valid_constant_size_p (hi) ? tree_to_shwi (hi) : -1;

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug c++/111357] __integer_pack fails to work with values of dependent type convertible to integers in noexcept context
  2023-09-10  2:16 [Bug libstdc++/111357] New: __integer_pack fails to work with values of dependent type convertible to integers frankhb1989 at gmail dot com
  2023-09-10  3:33 ` [Bug c++/111357] " pinskia at gcc dot gnu.org
@ 2023-09-10  3:52 ` pinskia at gcc dot gnu.org
  2023-09-10  3:56 ` [Bug c++/111357] [11/12/13/14 Regression] " pinskia at gcc dot gnu.org
                   ` (12 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-09-10  3:52 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2023-09-10
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Reduced slightly:
```
#include <utility>

using std::integer_sequence;
using std::make_integer_sequence;

template<int... V>
void g(integer_sequence<int,V...>)
{}

template<typename ...T>
struct c1
{
  static constexpr int value = 1;
  constexpr operator int() { return value; } 
};
template<typename T>
struct R
{
        using S = make_integer_sequence<int,c1<T>{}>;

        R() noexcept(noexcept(g(S())))
        {}
};
int main()
{
        R<int>();
}
```

The obvious workaround in this case (and the tuple_size case) is to use
`::value` (or tuple_size_v ).

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug c++/111357] [11/12/13/14 Regression] __integer_pack fails to work with values of dependent type convertible to integers in noexcept context
  2023-09-10  2:16 [Bug libstdc++/111357] New: __integer_pack fails to work with values of dependent type convertible to integers frankhb1989 at gmail dot com
  2023-09-10  3:33 ` [Bug c++/111357] " pinskia at gcc dot gnu.org
  2023-09-10  3:52 ` [Bug c++/111357] __integer_pack fails to work with values of dependent type convertible to integers in noexcept context pinskia at gcc dot gnu.org
@ 2023-09-10  3:56 ` pinskia at gcc dot gnu.org
  2023-09-11  8:54 ` redi at gcc dot gnu.org
                   ` (11 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-09-10  3:56 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=80396
            Summary|__integer_pack fails to     |[11/12/13/14 Regression]
                   |work with values of         |__integer_pack fails to
                   |dependent type convertible  |work with values of
                   |to integers in noexcept     |dependent type convertible
                   |context                     |to integers in noexcept
                   |                            |context
   Target Milestone|---                         |11.5

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I think this is techincally a regression as the user code is now being
rejected;  even though the builtin was only added in GCC 8
(r8-871-gf0c1ade45a74 ).

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug c++/111357] [11/12/13/14 Regression] __integer_pack fails to work with values of dependent type convertible to integers in noexcept context
  2023-09-10  2:16 [Bug libstdc++/111357] New: __integer_pack fails to work with values of dependent type convertible to integers frankhb1989 at gmail dot com
                   ` (2 preceding siblings ...)
  2023-09-10  3:56 ` [Bug c++/111357] [11/12/13/14 Regression] " pinskia at gcc dot gnu.org
@ 2023-09-11  8:54 ` redi at gcc dot gnu.org
  2023-09-11 13:39 ` jason at gcc dot gnu.org
                   ` (10 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: redi at gcc dot gnu.org @ 2023-09-11  8:54 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Reduced to remove <utility>:

namespace std {
  template<typename _Tp, _Tp... _Idx>
    struct integer_sequence
    { };

  template<typename _Tp, _Tp _Num>
    using make_integer_sequence
      = integer_sequence<_Tp, __integer_pack(_Num)...>;
}

using std::integer_sequence;
using std::make_integer_sequence;

template<int... V>
void g(integer_sequence<int,V...>)
{}

template<typename ...T>
struct c1
{
  static constexpr int value = 1;
  constexpr operator int() { return value; } 
};
template<typename T>
struct R
{
        using S = make_integer_sequence<int,c1<T>{}>;

        R() noexcept(noexcept(g(S())))
        {}
};
int main()
{
        R<int>();
}

This certainly seems like a front end bug not a libstdc++ one, but the library
can make it work by casting _Tp _Num to its own type:

  template<typename _Tp, _Tp _Num>
    using make_integer_sequence
      = integer_sequence<_Tp, __integer_pack(_Tp(_Num))...>;

This should not be needed, but makes it work.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug c++/111357] [11/12/13/14 Regression] __integer_pack fails to work with values of dependent type convertible to integers in noexcept context
  2023-09-10  2:16 [Bug libstdc++/111357] New: __integer_pack fails to work with values of dependent type convertible to integers frankhb1989 at gmail dot com
                   ` (3 preceding siblings ...)
  2023-09-11  8:54 ` redi at gcc dot gnu.org
@ 2023-09-11 13:39 ` jason at gcc dot gnu.org
  2023-09-11 13:43 ` jakub at gcc dot gnu.org
                   ` (9 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: jason at gcc dot gnu.org @ 2023-09-11 13:39 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
                 CC|                            |jason at gcc dot gnu.org
           Assignee|unassigned at gcc dot gnu.org      |jason at gcc dot gnu.org

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug c++/111357] [11/12/13/14 Regression] __integer_pack fails to work with values of dependent type convertible to integers in noexcept context
  2023-09-10  2:16 [Bug libstdc++/111357] New: __integer_pack fails to work with values of dependent type convertible to integers frankhb1989 at gmail dot com
                   ` (4 preceding siblings ...)
  2023-09-11 13:39 ` jason at gcc dot gnu.org
@ 2023-09-11 13:43 ` jakub at gcc dot gnu.org
  2023-09-12 17:27 ` cvs-commit at gcc dot gnu.org
                   ` (8 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-09-11 13:43 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Seems when expand_integer_pack is called first time, ohi is
TEMPLATE_PARAMETER_INDEX
with the right type (_Tp TEMPLATE_TYPE_PARM), but when it calls
  tree hi = tsubst_copy_and_build (ohi, args, complain, in_decl);
it returns an empty CONSTRUCTOR with c1 type.
Dunno if the bug is that tsubst didn't convert it to _Tp type or if it would be
normally a task for something done later on.
And we then
      if (hi != ohi)
        {
          call = copy_node (call);
          CALL_EXPR_ARG (call, 0) = hi;
        }

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug c++/111357] [11/12/13/14 Regression] __integer_pack fails to work with values of dependent type convertible to integers in noexcept context
  2023-09-10  2:16 [Bug libstdc++/111357] New: __integer_pack fails to work with values of dependent type convertible to integers frankhb1989 at gmail dot com
                   ` (5 preceding siblings ...)
  2023-09-11 13:43 ` jakub at gcc dot gnu.org
@ 2023-09-12 17:27 ` cvs-commit at gcc dot gnu.org
  2023-09-14 13:27 ` cvs-commit at gcc dot gnu.org
                   ` (7 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-09-12 17:27 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Jason Merrill <jason@gcc.gnu.org>:

https://gcc.gnu.org/g:f73d2d61a5926f42e9e5d771d23868787ef9d800

commit r14-3908-gf73d2d61a5926f42e9e5d771d23868787ef9d800
Author: Jason Merrill <jason@redhat.com>
Date:   Mon Sep 11 09:40:32 2023 -0400

    c++: __integer_pack with class argument [PR111357]

    The argument might not already be an integer.

            PR c++/111357

    gcc/cp/ChangeLog:

            * pt.cc (expand_integer_pack): Convert argument to int.

    gcc/testsuite/ChangeLog:

            * g++.dg/ext/integer-pack7.C: New test.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug c++/111357] [11/12/13/14 Regression] __integer_pack fails to work with values of dependent type convertible to integers in noexcept context
  2023-09-10  2:16 [Bug libstdc++/111357] New: __integer_pack fails to work with values of dependent type convertible to integers frankhb1989 at gmail dot com
                   ` (6 preceding siblings ...)
  2023-09-12 17:27 ` cvs-commit at gcc dot gnu.org
@ 2023-09-14 13:27 ` cvs-commit at gcc dot gnu.org
  2023-09-14 13:39 ` cvs-commit at gcc dot gnu.org
                   ` (6 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-09-14 13:27 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>:

https://gcc.gnu.org/g:557a858f2ead4ae8b64b157d7fd33830a81646d5

commit r14-3992-g557a858f2ead4ae8b64b157d7fd33830a81646d5
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Thu Sep 14 09:18:34 2023 +0100

    libstdc++: Add testcase for std::make_integer_sequence bug [PR111357]

    The compiler bug has been fixed on trunk, but this adds a regression test
    for the library component.

    libstdc++-v3/ChangeLog:

            PR c++/111357
            * testsuite/20_util/integer_sequence/pr111357.cc: New test.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug c++/111357] [11/12/13/14 Regression] __integer_pack fails to work with values of dependent type convertible to integers in noexcept context
  2023-09-10  2:16 [Bug libstdc++/111357] New: __integer_pack fails to work with values of dependent type convertible to integers frankhb1989 at gmail dot com
                   ` (7 preceding siblings ...)
  2023-09-14 13:27 ` cvs-commit at gcc dot gnu.org
@ 2023-09-14 13:39 ` cvs-commit at gcc dot gnu.org
  2023-09-14 13:40 ` cvs-commit at gcc dot gnu.org
                   ` (5 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-09-14 13:39 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-13 branch has been updated by Jonathan Wakely
<redi@gcc.gnu.org>:

https://gcc.gnu.org/g:7b0abd4a8ee9d2057febe443de67009dcdfe7574

commit r13-7817-g7b0abd4a8ee9d2057febe443de67009dcdfe7574
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Thu Sep 14 09:18:34 2023 +0100

    libstdc++: Add workaround for std::make_integer_sequence bug [PR111357]

    The compiler bug has been fixed on trunk, but we need this workaround on
    the branches.

    libstdc++-v3/ChangeLog:

            PR c++/111357
            * include/bits/utility.h (make_integer_sequence): Add cast.
            * testsuite/20_util/integer_sequence/pr111357.cc: New test.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug c++/111357] [11/12/13/14 Regression] __integer_pack fails to work with values of dependent type convertible to integers in noexcept context
  2023-09-10  2:16 [Bug libstdc++/111357] New: __integer_pack fails to work with values of dependent type convertible to integers frankhb1989 at gmail dot com
                   ` (8 preceding siblings ...)
  2023-09-14 13:39 ` cvs-commit at gcc dot gnu.org
@ 2023-09-14 13:40 ` cvs-commit at gcc dot gnu.org
  2023-09-14 13:42 ` cvs-commit at gcc dot gnu.org
                   ` (4 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-09-14 13:40 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-12 branch has been updated by Jonathan Wakely
<redi@gcc.gnu.org>:

https://gcc.gnu.org/g:eba46f1137683b6f92ea6f95ed84e3e5cfc42377

commit r12-9877-geba46f1137683b6f92ea6f95ed84e3e5cfc42377
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Thu Sep 14 09:18:34 2023 +0100

    libstdc++: Add workaround for std::make_integer_sequence bug [PR111357]

    The compiler bug has been fixed on trunk, but we need this workaround on
    the branches.

    libstdc++-v3/ChangeLog:

            PR c++/111357
            * include/bits/utility.h (make_integer_sequence): Add cast.
            * testsuite/20_util/integer_sequence/pr111357.cc: New test.

    (cherry picked from commit 7b0abd4a8ee9d2057febe443de67009dcdfe7574)

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug c++/111357] [11/12/13/14 Regression] __integer_pack fails to work with values of dependent type convertible to integers in noexcept context
  2023-09-10  2:16 [Bug libstdc++/111357] New: __integer_pack fails to work with values of dependent type convertible to integers frankhb1989 at gmail dot com
                   ` (9 preceding siblings ...)
  2023-09-14 13:40 ` cvs-commit at gcc dot gnu.org
@ 2023-09-14 13:42 ` cvs-commit at gcc dot gnu.org
  2023-09-22 14:36 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-09-14 13:42 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Jonathan Wakely
<redi@gcc.gnu.org>:

https://gcc.gnu.org/g:27fce25cc07f7efe11db05eb2fe74a465c41475f

commit r11-11008-g27fce25cc07f7efe11db05eb2fe74a465c41475f
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Thu Sep 14 09:18:34 2023 +0100

    libstdc++: Add workaround for std::make_integer_sequence bug [PR111357]

    The compiler bug has been fixed on trunk, but we need this workaround on
    the branches.

    libstdc++-v3/ChangeLog:

            PR c++/111357
            * include/std/utility (make_integer_sequence): Add cast.
            * testsuite/20_util/integer_sequence/pr111357.cc: New test.

    (cherry picked from commit 7b0abd4a8ee9d2057febe443de67009dcdfe7574)

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug c++/111357] [11/12/13/14 Regression] __integer_pack fails to work with values of dependent type convertible to integers in noexcept context
  2023-09-10  2:16 [Bug libstdc++/111357] New: __integer_pack fails to work with values of dependent type convertible to integers frankhb1989 at gmail dot com
                   ` (10 preceding siblings ...)
  2023-09-14 13:42 ` cvs-commit at gcc dot gnu.org
@ 2023-09-22 14:36 ` cvs-commit at gcc dot gnu.org
  2023-09-23  7:41 ` jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-09-22 14:36 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #11 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Jason Merrill <jason@gcc.gnu.org>:

https://gcc.gnu.org/g:fd35d72a3dcd5ba14d81a1890236acd0145497e1

commit r14-4231-gfd35d72a3dcd5ba14d81a1890236acd0145497e1
Author: Jason Merrill <jason@redhat.com>
Date:   Thu Sep 21 15:39:46 2023 +0100

    c++ __integer_pack conversion again [PR111357]

    As Jakub pointed out, the real problem here is that in a partial
    substitution we're forgetting the conversion to the type of the non-type
    template argument, because maybe_convert_nontype_argument doesn't do
    anything with value-dependent arguments.  I'm experimenting with changing
    that, but in the meantime we can work around it here.

            PR c++/111357

    gcc/cp/ChangeLog:

            * pt.cc (expand_integer_pack): Use IMPLICIT_CONV_EXPR.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug c++/111357] [11/12/13/14 Regression] __integer_pack fails to work with values of dependent type convertible to integers in noexcept context
  2023-09-10  2:16 [Bug libstdc++/111357] New: __integer_pack fails to work with values of dependent type convertible to integers frankhb1989 at gmail dot com
                   ` (11 preceding siblings ...)
  2023-09-22 14:36 ` cvs-commit at gcc dot gnu.org
@ 2023-09-23  7:41 ` jakub at gcc dot gnu.org
  2024-01-19 18:35 ` cvs-commit at gcc dot gnu.org
  2024-01-19 19:29 ` jason at gcc dot gnu.org
  14 siblings, 0 replies; 16+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-09-23  7:41 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #12 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
*** Bug 111455 has been marked as a duplicate of this bug. ***

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug c++/111357] [11/12/13/14 Regression] __integer_pack fails to work with values of dependent type convertible to integers in noexcept context
  2023-09-10  2:16 [Bug libstdc++/111357] New: __integer_pack fails to work with values of dependent type convertible to integers frankhb1989 at gmail dot com
                   ` (12 preceding siblings ...)
  2023-09-23  7:41 ` jakub at gcc dot gnu.org
@ 2024-01-19 18:35 ` cvs-commit at gcc dot gnu.org
  2024-01-19 19:29 ` jason at gcc dot gnu.org
  14 siblings, 0 replies; 16+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-01-19 18:35 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #13 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Jason Merrill <jason@gcc.gnu.org>:

https://gcc.gnu.org/g:f1e5bf0d83ee4da81b6317c6d7f1278fe7eaa5a0

commit r14-8291-gf1e5bf0d83ee4da81b6317c6d7f1278fe7eaa5a0
Author: Jason Merrill <jason@redhat.com>
Date:   Wed Jan 17 17:29:33 2024 -0500

    c++: alias template argument conversion [PR112632]

    We've had a problem with lost conversions to template parameter types for a
    while now; looking at this PR, it occurred to me that the problem is really
    with alias (and concept) templates, since we do substitution of dependent
    arguments into them in a way that we don't for other templates.  And fixing
    that specific problem is a lot simpler than adding IMPLICIT_CONV_EXPR
around
    all dependent template arguments the way I gave up on for 111357.

    The other part of the fix was changing tsubst_expr to actually call
    convert_nontype_argument instead of assuming it will eventually happen.

    I waffled about stripping the forced conversion when !force_conv
    vs. skipping them in iterative_hash_template_arg and
    template_args_equal (like we already do for some other conversions) and
    decided to go with the former, but that isn't a strong preference if it
    turns out to be somehow problematic.

            PR c++/112632
            PR c++/112594
            PR c++/111357
            PR c++/104594
            PR c++/67898

    gcc/cp/ChangeLog:

            * cp-tree.h (IMPLICIT_CONV_EXPR_FORCED): New.
            * pt.cc (expand_integer_pack): Remove 111357 workaround.
            (maybe_convert_nontype_argument): Add force parm.
            (convert_template_argument): Handle alias template args
            specially.
            (tsubst_expr): Don't ignore IMPLICIT_CONV_EXPR_NONTYPE_ARG.
            * error.cc (dump_expr) [CASE_CONVERT]: Handle null optype.

    gcc/testsuite/ChangeLog:

            * g++.dg/cpp0x/alias-decl-nontype1.C: New test.
            * g++.dg/cpp2a/concepts-narrowing1.C: New test.
            * g++.dg/cpp2a/nontype-class63.C: New test.
            * g++.dg/cpp2a/nontype-class63a.C: New test.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug c++/111357] [11/12/13/14 Regression] __integer_pack fails to work with values of dependent type convertible to integers in noexcept context
  2023-09-10  2:16 [Bug libstdc++/111357] New: __integer_pack fails to work with values of dependent type convertible to integers frankhb1989 at gmail dot com
                   ` (13 preceding siblings ...)
  2024-01-19 18:35 ` cvs-commit at gcc dot gnu.org
@ 2024-01-19 19:29 ` jason at gcc dot gnu.org
  14 siblings, 0 replies; 16+ messages in thread
From: jason at gcc dot gnu.org @ 2024-01-19 19:29 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #14 from Jason Merrill <jason at gcc dot gnu.org> ---
The library pattern is fixed on all branches; the built-in doesn't need to be.

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2024-01-19 19:29 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-10  2:16 [Bug libstdc++/111357] New: __integer_pack fails to work with values of dependent type convertible to integers frankhb1989 at gmail dot com
2023-09-10  3:33 ` [Bug c++/111357] " pinskia at gcc dot gnu.org
2023-09-10  3:52 ` [Bug c++/111357] __integer_pack fails to work with values of dependent type convertible to integers in noexcept context pinskia at gcc dot gnu.org
2023-09-10  3:56 ` [Bug c++/111357] [11/12/13/14 Regression] " pinskia at gcc dot gnu.org
2023-09-11  8:54 ` redi at gcc dot gnu.org
2023-09-11 13:39 ` jason at gcc dot gnu.org
2023-09-11 13:43 ` jakub at gcc dot gnu.org
2023-09-12 17:27 ` cvs-commit at gcc dot gnu.org
2023-09-14 13:27 ` cvs-commit at gcc dot gnu.org
2023-09-14 13:39 ` cvs-commit at gcc dot gnu.org
2023-09-14 13:40 ` cvs-commit at gcc dot gnu.org
2023-09-14 13:42 ` cvs-commit at gcc dot gnu.org
2023-09-22 14:36 ` cvs-commit at gcc dot gnu.org
2023-09-23  7:41 ` jakub at gcc dot gnu.org
2024-01-19 18:35 ` cvs-commit at gcc dot gnu.org
2024-01-19 19:29 ` jason at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).