public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/59701] New: A variadic alias template aliasing another variadic alias template doesn't work
@ 2014-01-06 15:17 ville.voutilainen at gmail dot com
  2014-01-10 20:34 ` [Bug c++/59701] " ville.voutilainen at gmail dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: ville.voutilainen at gmail dot com @ 2014-01-06 15:17 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59701

            Bug ID: 59701
           Summary: A variadic alias template aliasing another variadic
                    alias template doesn't work
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ville.voutilainen at gmail dot com

template<typename... Args> struct foo { };
template<typename T, typename... Args> using bar = foo<T, Args...>;
template<typename T, typename... Args> using baz = bar<Args..., T>;

int
main (int argc, char *argv[])
{

}

This gives

edoceo7.cpp: In substitution of ‘template<class T, class ... Args> using bar =
foo<T, Args ...> [with T = Args ...; Args = {<expression error>}]’:
edoceo7.cpp:3:66:   required from here
edoceo7.cpp:2:67: error: template argument 2 is invalid
 template<typename T, typename... Args> using bar = foo<T, Args...>;
                                                                   ^
Multiple clang versions accept the code. Some clang versions ICE on it, but
that's another matter. :)
>From gcc-bugs-return-439399-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Jan 06 15:35:33 2014
Return-Path: <gcc-bugs-return-439399-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 22978 invoked by alias); 6 Jan 2014 15:35:33 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 22910 invoked by uid 48); 6 Jan 2014 15:35:30 -0000
From: "ville.voutilainen at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/59702] New: Infinite recursion in a late-specified return type of a function template
Date: Mon, 06 Jan 2014 15:35:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: ville.voutilainen at gmail dot com
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter
Message-ID: <bug-59702-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-01/txt/msg00541.txt.bz2
Content-length: 2126

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59702

            Bug ID: 59702
           Summary: Infinite recursion in a late-specified return type of
                    a function template
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ville.voutilainen at gmail dot com

struct A {};

template<typename>
int func (A) {
  return {};
}

template<typename T>
auto func () -> decltype (func<T> (A{})) {
  return {};
}

int
main (int argc, char *argv[])
{
  func<int> ();
}

Result:

edoceo8.cpp:9:39: error: template instantiation depth exceeds maximum of 900
(use -ftemplate-depth= to increase the maximum) substituting ‘template<class T>
decltype (func<T>(A{})) func() [with T = int]’
 auto func () -> decltype (func<T> (A{})) {
                                       ^
edoceo8.cpp:9:39:   recursively required by substitution of ‘template<class T>
decltype (func<T>(A{})) func() [with T = int]’
edoceo8.cpp:9:39:   required by substitution of ‘template<class T> decltype
(func<T>(A{})) func() [with T = int]’
edoceo8.cpp:16:14:   required from here

edoceo8.cpp: In function ‘int main(int, char**)’:
edoceo8.cpp:16:14: error: no matching function for call to ‘func()’
   func<int> ();
              ^
edoceo8.cpp:16:14: note: candidates are:
edoceo8.cpp:4:5: note: template<class> int func(A)
 int func (A) {
     ^
edoceo8.cpp:4:5: note:   template argument deduction/substitution failed:
edoceo8.cpp:16:14: note:   candidate expects 1 argument, 0 provided
   func<int> ();
              ^
edoceo8.cpp:9:6: note: template<class T> decltype (func<T>(A{})) func()
 auto func () -> decltype (func<T> (A{})) {
      ^
edoceo8.cpp:9:6: note:   substitution of deduced template arguments resulted in
errors seen above


It doesn't seem to me like the late-specified return type is even referring to
the return type of the latter function template.
>From gcc-bugs-return-439400-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Jan 06 15:44:12 2014
Return-Path: <gcc-bugs-return-439400-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 29848 invoked by alias); 6 Jan 2014 15:44:11 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 29821 invoked by uid 48); 6 Jan 2014 15:44:08 -0000
From: "ville.voutilainen at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/59702] Infinite recursion in a late-specified return type of a function template
Date: Mon, 06 Jan 2014 15:44:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: ville.voutilainen at gmail dot com
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-59702-4-1zNKKDRYfH@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-59702-4@http.gcc.gnu.org/bugzilla/>
References: <bug-59702-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-01/txt/msg00542.txt.bz2
Content-length: 180

http://gcc.gnu.org/bugzilla/show_bug.cgi?idY702

--- Comment #1 from Ville Voutilainen <ville.voutilainen at gmail dot com> ---
I forgot to mention that clang accepts the code.


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

* [Bug c++/59701] A variadic alias template aliasing another variadic alias template doesn't work
  2014-01-06 15:17 [Bug c++/59701] New: A variadic alias template aliasing another variadic alias template doesn't work ville.voutilainen at gmail dot com
@ 2014-01-10 20:34 ` ville.voutilainen at gmail dot com
  2015-03-18 20:22 ` [Bug c++/59701] [DR 1430] " paolo.carlini at oracle dot com
  2021-08-23  6:40 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: ville.voutilainen at gmail dot com @ 2014-01-10 20:34 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59701

--- Comment #1 from Ville Voutilainen <ville.voutilainen at gmail dot com> ---
The testcase caused an ICE in recent versions of clang, and was fixed so that
the code is rejected by clang. This is related to Core Issue 1430, so the bug
should probably be on hold until CWG decides the outcome of that issue.


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

* [Bug c++/59701] [DR 1430] A variadic alias template aliasing another variadic alias template doesn't work
  2014-01-06 15:17 [Bug c++/59701] New: A variadic alias template aliasing another variadic alias template doesn't work ville.voutilainen at gmail dot com
  2014-01-10 20:34 ` [Bug c++/59701] " ville.voutilainen at gmail dot com
@ 2015-03-18 20:22 ` paolo.carlini at oracle dot com
  2021-08-23  6:40 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: paolo.carlini at oracle dot com @ 2015-03-18 20:22 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |SUSPENDED
   Last reconfirmed|                            |2015-03-18
            Summary|A variadic alias template   |[DR 1430] A variadic alias
                   |aliasing another variadic   |template aliasing another
                   |alias template doesn't work |variadic alias template
                   |                            |doesn't work
     Ever confirmed|0                           |1

--- Comment #2 from Paolo Carlini <paolo.carlini at oracle dot com> ---
This one too, I suppose, like c++/60273.


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

* [Bug c++/59701] [DR 1430] A variadic alias template aliasing another variadic alias template doesn't work
  2014-01-06 15:17 [Bug c++/59701] New: A variadic alias template aliasing another variadic alias template doesn't work ville.voutilainen at gmail dot com
  2014-01-10 20:34 ` [Bug c++/59701] " ville.voutilainen at gmail dot com
  2015-03-18 20:22 ` [Bug c++/59701] [DR 1430] " paolo.carlini at oracle dot com
@ 2021-08-23  6:40 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-23  6:40 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
MSVC rejects with:
<source>(3): error C2210: 'T': pack expansions cannot be used as arguments to
non-packed parameters in alias templates

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

end of thread, other threads:[~2021-08-23  6:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-06 15:17 [Bug c++/59701] New: A variadic alias template aliasing another variadic alias template doesn't work ville.voutilainen at gmail dot com
2014-01-10 20:34 ` [Bug c++/59701] " ville.voutilainen at gmail dot com
2015-03-18 20:22 ` [Bug c++/59701] [DR 1430] " paolo.carlini at oracle dot com
2021-08-23  6:40 ` 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).