public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/94102] New: Variadic template deduction guide issue - error: 'In instantiation of'
@ 2020-03-09 16:00 rosemberg at ymail dot com
  2020-03-09 16:01 ` [Bug c++/94102] " rosemberg at ymail dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: rosemberg at ymail dot com @ 2020-03-09 16:00 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 94102
           Summary: Variadic template deduction guide issue - error: 'In
                    instantiation of'
           Product: gcc
           Version: 9.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rosemberg at ymail dot com
  Target Milestone: ---

The gcc9.2 (I tested with gcc7) return the follow error due the deduction guide
declaration:

In instantiation of 'Merged::Merged(T&& ...) (with T = {const main()::&, const
main()::&, main()::}; B = {}]':

#include <utility>

template<typename ... B>
struct Merged : B ... {
       template<typename ... T>
       Merged(T&& ... t) : B(std::forward<T>(t))... {}

    using B::operator()...;
};

template<typename ... T>
Merged(T...) -> Merged<std::decay_t<T>...>;

int main() {
    const auto l1 = []() { return 4; };
    const auto l2 = [](const int i) { return i * 10; };

    Merged merged(l1,
                  l2,
                  [](const double d) { return d * 3.2; });

    return 0;
}

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

* [Bug c++/94102] Variadic template deduction guide issue - error: 'In instantiation of'
  2020-03-09 16:00 [Bug c++/94102] New: Variadic template deduction guide issue - error: 'In instantiation of' rosemberg at ymail dot com
@ 2020-03-09 16:01 ` rosemberg at ymail dot com
  2020-03-09 16:10 ` rosemberg at ymail dot com
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: rosemberg at ymail dot com @ 2020-03-09 16:01 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from rosemberg at ymail dot com ---
The work around to solve it was to add the follow deduction guide:

template <typename T0, typename ... T>
Merged (T0, T ...) 
   -> Merged<std::decay_t<T0>, std::decay_t<T>...>;

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

* [Bug c++/94102] Variadic template deduction guide issue - error: 'In instantiation of'
  2020-03-09 16:00 [Bug c++/94102] New: Variadic template deduction guide issue - error: 'In instantiation of' rosemberg at ymail dot com
  2020-03-09 16:01 ` [Bug c++/94102] " rosemberg at ymail dot com
@ 2020-03-09 16:10 ` rosemberg at ymail dot com
  2020-09-16 19:38 ` mpolacek at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: rosemberg at ymail dot com @ 2020-03-09 16:10 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from rosemberg at ymail dot com ---
*** Bug 94101 has been marked as a duplicate of this bug. ***

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

* [Bug c++/94102] Variadic template deduction guide issue - error: 'In instantiation of'
  2020-03-09 16:00 [Bug c++/94102] New: Variadic template deduction guide issue - error: 'In instantiation of' rosemberg at ymail dot com
  2020-03-09 16:01 ` [Bug c++/94102] " rosemberg at ymail dot com
  2020-03-09 16:10 ` rosemberg at ymail dot com
@ 2020-09-16 19:38 ` mpolacek at gcc dot gnu.org
  2021-04-29 17:37 ` cvs-commit at gcc dot gnu.org
  2021-04-29 17:38 ` mpolacek at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-09-16 19:38 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2020-09-16
           Assignee|unassigned at gcc dot gnu.org      |mpolacek at gcc dot gnu.org
     Ever confirmed|0                           |1
                 CC|                            |mpolacek at gcc dot gnu.org

--- Comment #3 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Fixed by r11-1571.

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

* [Bug c++/94102] Variadic template deduction guide issue - error: 'In instantiation of'
  2020-03-09 16:00 [Bug c++/94102] New: Variadic template deduction guide issue - error: 'In instantiation of' rosemberg at ymail dot com
                   ` (2 preceding siblings ...)
  2020-09-16 19:38 ` mpolacek at gcc dot gnu.org
@ 2021-04-29 17:37 ` cvs-commit at gcc dot gnu.org
  2021-04-29 17:38 ` mpolacek at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-04-29 17:37 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Marek Polacek <mpolacek@gcc.gnu.org>:

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

commit r12-294-gf24702258fc78ac37b3e8154d76239cccd30c422
Author: Marek Polacek <polacek@redhat.com>
Date:   Thu Apr 29 13:30:39 2021 -0400

    c++: Add testcase for already fixed PR [PR94102]

    We correctly accept this testcase since r11-1571.

    gcc/testsuite/ChangeLog:

            PR c++/94102
            * g++.dg/cpp1z/class-deduction87.C: New test.

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

* [Bug c++/94102] Variadic template deduction guide issue - error: 'In instantiation of'
  2020-03-09 16:00 [Bug c++/94102] New: Variadic template deduction guide issue - error: 'In instantiation of' rosemberg at ymail dot com
                   ` (3 preceding siblings ...)
  2021-04-29 17:37 ` cvs-commit at gcc dot gnu.org
@ 2021-04-29 17:38 ` mpolacek at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2021-04-29 17:38 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

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

--- Comment #5 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Reduced test added.

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

end of thread, other threads:[~2021-04-29 17:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-09 16:00 [Bug c++/94102] New: Variadic template deduction guide issue - error: 'In instantiation of' rosemberg at ymail dot com
2020-03-09 16:01 ` [Bug c++/94102] " rosemberg at ymail dot com
2020-03-09 16:10 ` rosemberg at ymail dot com
2020-09-16 19:38 ` mpolacek at gcc dot gnu.org
2021-04-29 17:37 ` cvs-commit at gcc dot gnu.org
2021-04-29 17:38 ` mpolacek 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).