public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/17410] New: selects general template instead of valid specialization with nested template
@ 2004-09-10 21:13 cppljevans at cox-internet dot com
  2004-09-10 21:17 ` [Bug c++/17410] " cppljevans at cox-internet dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: cppljevans at cox-internet dot com @ 2004-09-10 21:13 UTC (permalink / raw)
  To: gcc-bugs

The specialization:

    template
      < typename Referent
      , template<typename>class OwnershipTmpl
      >
      class
    cycle_basis_mgr
      < OwnershipTmpl<Referent*> 
      >
    {...};

is not selected when OwnershipTmpl is a nested template even
though the non-deduced context is resolved by the nester_of
specialization, as demonstrated by the successful icc compile.

Will supply a file with all information requested by:

http://gcc.gnu.org/bugs.html

-- 
           Summary: selects general template instead of valid specialization
                    with nested template
           Product: gcc
           Version: 3.4.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: cppljevans at cox-internet dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: ./configure --prefix=/usr/local/gcc-3.4.1 --enable-
                    languages=c++
  GCC host triplet: Linux null.localdomain.fake 2.4.18-bf2.4 #1 Son Apr 14
                    09:53:28


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


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

* [Bug c++/17410] selects general template instead of valid specialization with nested template
  2004-09-10 21:13 [Bug c++/17410] New: selects general template instead of valid specialization with nested template cppljevans at cox-internet dot com
@ 2004-09-10 21:17 ` cppljevans at cox-internet dot com
  2004-09-11  1:51 ` giovannibajo at libero dot it
  2004-09-11 14:02 ` [Bug c++/17410] Specialization of nested template rejected because of unrelated declaration cppljevans at cox-internet dot com
  2 siblings, 0 replies; 4+ messages in thread
From: cppljevans at cox-internet dot com @ 2004-09-10 21:17 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cppljevans at cox-internet dot com  2004-09-10 21:17 -------
Created an attachment (id=7091)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=7091&action=view)
Output from makefile showing system, gcc build params, and icc vs gcc compile


-- 


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


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

* [Bug c++/17410] selects general template instead of valid specialization with nested template
  2004-09-10 21:13 [Bug c++/17410] New: selects general template instead of valid specialization with nested template cppljevans at cox-internet dot com
  2004-09-10 21:17 ` [Bug c++/17410] " cppljevans at cox-internet dot com
@ 2004-09-11  1:51 ` giovannibajo at libero dot it
  2004-09-11 14:02 ` [Bug c++/17410] Specialization of nested template rejected because of unrelated declaration cppljevans at cox-internet dot com
  2 siblings, 0 replies; 4+ messages in thread
From: giovannibajo at libero dot it @ 2004-09-11  1:51 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From giovannibajo at libero dot it  2004-09-11 01:51 -------
This is weird. Redux:

-------------------------------------------------------
template <class>
struct Outer {
  template <class> struct Inner {};
}; 

template <class T>
struct A;

template <template <class> class Q, class P>
struct A <Q<P> > {};

template <class T> struct UNRELATED;
template <class T> struct UNRELATED<Outer<void>::Inner<T*> >;

template struct A<Outer<void>::Inner<int*> >;
-------------------------------------------------------

This should be accepted, because the specialization of A should be matched
(with Q = "Outer<void>::Inner", and P = "int*" of course). Instead, it does 
not, *unless* you comment the UNRELATED template.

Looks like something gets alterated in the tsubst process. Not a regression, 
though (the original code manages to be rejected everywhere, while the redux 
even ICEs older compilers).

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |giovannibajo at libero dot
                   |                            |it
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
  GCC build triplet|./configure --              |
                   |prefix=/usr/local/gcc-3.4.1 |
                   |--enable-languages=c++      |
   GCC host triplet|Linux null.localdomain.fake |
                   |2.4.18-bf2.4 #1 Son Apr 14  |
                   |09:53:28                    |
           Keywords|                            |accepts-invalid, rejects-
                   |                            |valid, wrong-code
      Known to fail|                            |2.95.3 3.0.4 3.2.3 3.3.3
                   |                            |3.4.0 4.0.0
   Last reconfirmed|0000-00-00 00:00:00         |2004-09-11 01:51:22
               date|                            |


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


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

* [Bug c++/17410] Specialization of nested template rejected because of unrelated declaration
  2004-09-10 21:13 [Bug c++/17410] New: selects general template instead of valid specialization with nested template cppljevans at cox-internet dot com
  2004-09-10 21:17 ` [Bug c++/17410] " cppljevans at cox-internet dot com
  2004-09-11  1:51 ` giovannibajo at libero dot it
@ 2004-09-11 14:02 ` cppljevans at cox-internet dot com
  2 siblings, 0 replies; 4+ messages in thread
From: cppljevans at cox-internet dot com @ 2004-09-11 14:02 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cppljevans at cox-internet dot com  2004-09-11 14:02 -------
(In reply to comment #2)
> This is weird. Redux:
> 
> -------------------------------------------------------
> template <class>
> struct Outer {
>   template <class> struct Inner {};
> }; 
> 
> template <class T>
> struct A;
> 
> template <template <class> class Q, class P>
> struct A <Q<P> > {};
> 
> template <class T> struct UNRELATED;
> template <class T> struct UNRELATED<Outer<void>::Inner<T*> >;
> 
> template struct A<Outer<void>::Inner<int*> >;
> -------------------------------------------------------
> 
> This should be accepted, because the specialization of A should be matched
> (with Q = "Outer<void>::Inner", and P = "int*" of course). Instead, it does 
> not, *unless* you comment the UNRELATED template.

My new attachment contains a run which shows gcc instantiates
the specialization when the template argument is not nested; 
however, gcc instantiates the general template when the template
argument is nested.  icc does it correctly.  I've also attached
the test.mk makefile which I used.

> 
> Looks like something gets alterated in the tsubst process. Not a regression, 
> though (the original code manages to be rejected everywhere, while the redux 
> even ICEs older compilers).



-- 


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


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

end of thread, other threads:[~2004-09-11 14:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-10 21:13 [Bug c++/17410] New: selects general template instead of valid specialization with nested template cppljevans at cox-internet dot com
2004-09-10 21:17 ` [Bug c++/17410] " cppljevans at cox-internet dot com
2004-09-11  1:51 ` giovannibajo at libero dot it
2004-09-11 14:02 ` [Bug c++/17410] Specialization of nested template rejected because of unrelated declaration cppljevans at cox-internet 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).