public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/66586] New: Template backtrace is truncated/absent after 'template argument deduction/substitution failed:'
@ 2015-06-18 12:52 lucdanton at free dot fr
  2015-06-18 12:59 ` [Bug c++/66586] " redi at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: lucdanton at free dot fr @ 2015-06-18 12:52 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 66586
           Summary: Template backtrace is truncated/absent after 'template
                    argument deduction/substitution failed:'
           Product: gcc
           Version: 5.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: lucdanton at free dot fr
  Target Milestone: ---

Created attachment 35801
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35801&action=edit
Minimal testcase

I've noticed that sometimes GCC presents e.g.

> main.cpp:8:25: note:   template argument deduction/substitution failed:

but then entirely omits the template instantiation backtrace. I've had a hard
time reproducing it so far but I finally found an example. Also happens with
4.9.2. Unrolling the result template alias by hand into the return type of foo
produces the expected behaviour, with a backtrace pointing to the mistake.

$ g++-trunk --version
g++-trunk (GCC) 5.1.0
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ cat main.cpp
template<typename>
struct trivial { using type = int; };

template<typename... Xs>
using result = typename trivial<Xs...>::type;

template<typename... Xs>
constexpr result<Xs...> foo(Xs...)
{ return 0; }

int main()
{
    foo(0, 0);
}
$ g++-trunk -std=c++11 main.cpp
main.cpp: In function 'int main()':
main.cpp:13:13: error: no matching function for call to 'foo(int, int)'
     foo(0, 0);
             ^
main.cpp:8:25: note: candidate: template<class ... Xs> constexpr result<Xs ...>
foo(Xs ...)
 constexpr result<Xs...> foo(Xs...)
                         ^
main.cpp:8:25: note:   template argument deduction/substitution failed:
$ #prompt resumes here!


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

* [Bug c++/66586] Template backtrace is truncated/absent after 'template argument deduction/substitution failed:'
  2015-06-18 12:52 [Bug c++/66586] New: Template backtrace is truncated/absent after 'template argument deduction/substitution failed:' lucdanton at free dot fr
@ 2015-06-18 12:59 ` redi at gcc dot gnu.org
  2015-08-04 15:11 ` paolo.carlini at oracle dot com
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: redi at gcc dot gnu.org @ 2015-06-18 12:59 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-06-18
     Ever confirmed|0                           |1

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
I've seen this many times but never distilled it down. Thanks for the testcase.


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

* [Bug c++/66586] Template backtrace is truncated/absent after 'template argument deduction/substitution failed:'
  2015-06-18 12:52 [Bug c++/66586] New: Template backtrace is truncated/absent after 'template argument deduction/substitution failed:' lucdanton at free dot fr
  2015-06-18 12:59 ` [Bug c++/66586] " redi at gcc dot gnu.org
@ 2015-08-04 15:11 ` paolo.carlini at oracle dot com
  2024-04-06 23:16 ` pinskia at gcc dot gnu.org
  2024-04-06 23:16 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: paolo.carlini at oracle dot com @ 2015-08-04 15:11 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Happens in c++/66439 too.


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

* [Bug c++/66586] Template backtrace is truncated/absent after 'template argument deduction/substitution failed:'
  2015-06-18 12:52 [Bug c++/66586] New: Template backtrace is truncated/absent after 'template argument deduction/substitution failed:' lucdanton at free dot fr
  2015-06-18 12:59 ` [Bug c++/66586] " redi at gcc dot gnu.org
  2015-08-04 15:11 ` paolo.carlini at oracle dot com
@ 2024-04-06 23:16 ` pinskia at gcc dot gnu.org
  2024-04-06 23:16 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-04-06 23:16 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|                            |9.1.0
             Status|NEW                         |RESOLVED
      Known to fail|                            |8.5.0
         Resolution|---                         |DUPLICATE

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Dup.

*** This bug has been marked as a duplicate of bug 56842 ***

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

* [Bug c++/66586] Template backtrace is truncated/absent after 'template argument deduction/substitution failed:'
  2015-06-18 12:52 [Bug c++/66586] New: Template backtrace is truncated/absent after 'template argument deduction/substitution failed:' lucdanton at free dot fr
                   ` (2 preceding siblings ...)
  2024-04-06 23:16 ` pinskia at gcc dot gnu.org
@ 2024-04-06 23:16 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-04-06 23:16 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #4)
> Dup.
> 
> *** This bug has been marked as a duplicate of bug 56842 ***

I should dup and fixed in GCC 9.1.0.

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

end of thread, other threads:[~2024-04-06 23:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-18 12:52 [Bug c++/66586] New: Template backtrace is truncated/absent after 'template argument deduction/substitution failed:' lucdanton at free dot fr
2015-06-18 12:59 ` [Bug c++/66586] " redi at gcc dot gnu.org
2015-08-04 15:11 ` paolo.carlini at oracle dot com
2024-04-06 23:16 ` pinskia at gcc dot gnu.org
2024-04-06 23:16 ` pinskia 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).