public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "pinskia at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/66153] Internal compiler error in nested template function
Date: Tue, 21 Dec 2021 21:58:02 +0000	[thread overview]
Message-ID: <bug-66153-4-LgWcuUmskI@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-66153-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #10 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
A little more reduced:
template<class obj> struct c { obj data; };
struct r {};
template<int N,class obj> obj g(const obj &arg);
template<int N,class obj>
  auto g(const c<obj> & arg)
    -> c<decltype(g<N>(arg.data))>
{
  return c<decltype(g<N>(arg.data))>{};
}
int main()
{
  c<r > array;  
  g<1>(array);
}
---- CUT ----
Without the guide for the return type, GCC accepts the code. Somehow GCC is
messing up g<N>, Removing the template argument N also allows GCC to accept the
code.

      parent reply	other threads:[~2021-12-21 21:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-15  0:21 [Bug c++/66153] New: " paboyle at ph dot ed.ac.uk
2015-05-15 11:42 ` [Bug c++/66153] " paboyle at ph dot ed.ac.uk
2015-05-16  4:41 ` paboyle at ph dot ed.ac.uk
2015-05-23 12:47 ` paboyle at ph dot ed.ac.uk
2021-12-21 21:11 ` pinskia at gcc dot gnu.org
2021-12-21 21:29 ` pinskia at gcc dot gnu.org
2021-12-21 21:45 ` pinskia at gcc dot gnu.org
2021-12-21 21:58 ` pinskia at gcc dot gnu.org [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-66153-4-LgWcuUmskI@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).