Bug 29767 - partial specialization enclosed templates within the declaration of the enclosed class.
Summary: partial specialization enclosed templates within the declaration of the enclo...
Status: RESOLVED DUPLICATE of bug 14032
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.2.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: wrong-code
Depends on: 14032
Blocks:
  Show dependency treegraph
 
Reported: 2006-11-08 18:56 UTC by Pawel Sikora
Modified: 2006-11-09 05:35 UTC (History)
5 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
testcase (278 bytes, text/x-c++src)
2006-11-08 18:56 UTC, Pawel Sikora
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pawel Sikora 2006-11-08 18:56:21 UTC
gcc and msvc accept such code but produces different results.
is this code (in)valid? i'm not sure what behaviour is correct.
Comment 1 Pawel Sikora 2006-11-08 18:56:53 UTC
Created attachment 12569 [details]
testcase
Comment 2 Andrew Pinski 2006-11-08 19:25:17 UTC
This is valid code ...
Comment 3 Andrew Pinski 2006-11-08 19:28:10 UTC
as far as I can tell, GCC is incorrect in not using the specialized template.
In fact I replace A with int, it gives the correct output.
Comment 4 Wolfgang Bangerth 2006-11-08 22:57:53 UTC
This is a duplicate of another PR where we forget to substitute an
outer template argument in the specialization of an inner template.
I think it concerned a boolean value in that case, rather than a type.

W.
Comment 5 Andrew Pinski 2006-11-08 23:18:07 UTC
(In reply to comment #4)
> This is a duplicate of another PR where we forget to substitute an
> outer template argument in the specialization of an inner template.
> I think it concerned a boolean value in that case, rather than a type.

That is PR 14032.
Comment 6 Wolfgang Bangerth 2006-11-09 05:25:20 UTC
Indeed. They are duplicates.

*** This bug has been marked as a duplicate of 14032 ***
Comment 7 Wolfgang Bangerth 2006-11-09 05:35:27 UTC
(In reply to comment #0)
> gcc and msvc accept such code but produces different results.
> is this code (in)valid? i'm not sure what behaviour is correct.

The code is valid because it is a *partial* specialization of the member
template class. It would be invalid if it were a *complete* specialization.
In that case, the complete specialization would have to be declared outside
the outer class, i.e. at namespace scope.