public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/60177] New: Unable to deduce template base of derived class in function template accepting a simple-template-id
@ 2014-02-13 14:38 filip.roseen at gmail dot com
  2014-02-14 10:19 ` [Bug c++/60177] Unable to deduce template base of derived class in call to function taking a `simple-template-id` filip.roseen at gmail dot com
  2014-12-14 14:14 ` ville.voutilainen at gmail dot com
  0 siblings, 2 replies; 3+ messages in thread
From: filip.roseen at gmail dot com @ 2014-02-13 14:38 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 60177
           Summary: Unable to deduce template base of derived class in
                    function template accepting a simple-template-id
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: filip.roseen at gmail dot com

template<class> struct Base { };

struct Derived : Base<void> { };

template<template<typename> class TT, typename T>
void func (TT<T>) { }

int main () {
  func (Derived { });
}


- - - - - - - - - - - - - - - - - - - - - - - - - -

main.cpp: In function 'int main()':
main.cpp:9:20: error: no matching function for call to 'func(Derived)'
   func (Derived { });
                    ^
main.cpp:9:20: note: candidate is:
main.cpp:6:6: note: template<template<class> class TT, class T> void
func(TT<T>)
 void func (TT<T>) { }
      ^
main.cpp:6:6: note:   template argument deduction/substitution failed:
main.cpp:9:20: note:   can't deduce a template for 'TT<T>' from non-template
type 'Derived'
   func (Derived { });

- - - - - - - - - - - - - - - - - - - - - - - - - -

gcc rejects the snippet which is a violation of [temp.deduct.call]/4 (`clang`
and `msvc` accepts the code).

`TT<T>` is a `simple-template-id` and the standard says that if a derived type
is passed to such context it should be deduced to a suitable base of that
passed type. 

Correct behavior is that the deduced template parameters for `func (Derived
{})` should be `TT = Base, T = void`.


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

* [Bug c++/60177] Unable to deduce template base of derived class in call to function taking a `simple-template-id`
  2014-02-13 14:38 [Bug c++/60177] New: Unable to deduce template base of derived class in function template accepting a simple-template-id filip.roseen at gmail dot com
@ 2014-02-14 10:19 ` filip.roseen at gmail dot com
  2014-12-14 14:14 ` ville.voutilainen at gmail dot com
  1 sibling, 0 replies; 3+ messages in thread
From: filip.roseen at gmail dot com @ 2014-02-14 10:19 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Filip Roséen <filip.roseen at gmail dot com> ---
Created attachment 32133
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32133&action=edit
testcase.cpp
>From gcc-bugs-return-443544-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Feb 14 10:21:23 2014
Return-Path: <gcc-bugs-return-443544-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 2149 invoked by alias); 14 Feb 2014 10:21:22 -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 1897 invoked by uid 48); 14 Feb 2014 10:21:19 -0000
From: "ktietz at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/60193] [4.7.4/4.8/4.9 regression] ICE on big nested frame
Date: Fri, 14 Feb 2014 10:21:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: target
X-Bugzilla-Version: 4.7.4
X-Bugzilla-Keywords: ice-on-valid-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: ktietz at gcc dot gnu.org
X-Bugzilla-Status: ASSIGNED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.7.4
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status
Message-ID: <bug-60193-4-S04VdIngxB@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-60193-4@http.gcc.gnu.org/bugzilla/>
References: <bug-60193-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-02/txt/msg01301.txt.bz2
Content-length: 493

http://gcc.gnu.org/bugzilla/show_bug.cgi?id`193

Kai Tietz <ktietz at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |ASSIGNED

--- Comment #4 from Kai Tietz <ktietz at gcc dot gnu.org> ---
Confirmed.  It seems to be related to array-size?!?

During debugging I found that r10 seems to live, and rax doesn't. I will look
into it.


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

* [Bug c++/60177] Unable to deduce template base of derived class in call to function taking a `simple-template-id`
  2014-02-13 14:38 [Bug c++/60177] New: Unable to deduce template base of derived class in function template accepting a simple-template-id filip.roseen at gmail dot com
  2014-02-14 10:19 ` [Bug c++/60177] Unable to deduce template base of derived class in call to function taking a `simple-template-id` filip.roseen at gmail dot com
@ 2014-12-14 14:14 ` ville.voutilainen at gmail dot com
  1 sibling, 0 replies; 3+ messages in thread
From: ville.voutilainen at gmail dot com @ 2014-12-14 14:14 UTC (permalink / raw)
  To: gcc-bugs

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

Ville Voutilainen <ville.voutilainen at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-12-14
                 CC|                            |ville.voutilainen at gmail dot com
     Ever confirmed|0                           |1
      Known to fail|                            |4.8.2, 4.9.1, 5.0

--- Comment #2 from Ville Voutilainen <ville.voutilainen at gmail dot com> ---
Clang accepts the code.


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

end of thread, other threads:[~2014-12-14 14:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-13 14:38 [Bug c++/60177] New: Unable to deduce template base of derived class in function template accepting a simple-template-id filip.roseen at gmail dot com
2014-02-14 10:19 ` [Bug c++/60177] Unable to deduce template base of derived class in call to function taking a `simple-template-id` filip.roseen at gmail dot com
2014-12-14 14:14 ` ville.voutilainen at gmail dot com

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).