Bug 41341 - gcc fails to reject inclass partial specialization of inherited class template
Summary: gcc fails to reject inclass partial specialization of inherited class template
Status: RESOLVED WORKSFORME
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.3.2
: P3 normal
Target Milestone: 4.5.0
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-11 21:39 UTC by Tomasz Kêpczyñski
Modified: 2009-12-27 01:54 UTC (History)
1 user (show)

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


Attachments
the offending code (382 bytes, text/plain)
2009-09-11 21:40 UTC, Tomasz Kêpczyñski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tomasz Kêpczyñski 2009-09-11 21:39:12 UTC
In the attached code partial specialization of struct apply in struct METAFUNCTION2 should be rejected according to C++ Standard 14.7.3/3:

A declaration of a function template or class template being explicitly specialized shall be in scope at the point of declaration of an explicit specialization.

What's more troublesome is a fact that specialization in METAFUNCTION2 seems to affect the template in METAFUNCTION. The program produces:

int
double
double

while I would expect:

int
HELPER<float, double>
double
Comment 1 Tomasz Kêpczyñski 2009-09-11 21:40:03 UTC
Created attachment 18568 [details]
the offending code
Comment 2 Paolo Carlini 2009-12-27 01:54:55 UTC
Fixed for 4.5.0, not a regression, closing as fixed.