[PATCH] Fix core-DR1755 & llvm-PR17294 & PR16906 - partial specializations of class member templates
Faisal Vali
faisalv at yahoo.com
Mon Apr 21 20:39:26 PDT 2014
Hi rsmith, doug.gregor,
This patch accomplishes the following (based on feedback from core in issaquah - though wording is still being worked on by Jason Merrill):
- does not substitute member partial specializations, unless they are needed for instantiation
- the substitution of the partial specialization declaration (not inherit-clause and body) is done in a SFINAE context
- if the primary template is specialized it does not inherit partial specializations from the unspecialized prototype template
Once I have gathered feedback regarding this direction - I intend to use a similar strategy to fix static data member templates (i.e. variable templates within classes) and their partial specialization issues. Following that, I'll work on DR727 - that is allow defining full specializations where ever partial specializations are allowed to be defined (full specializations add functions to the mix).
Please see the test files for examples.
http://reviews.llvm.org/D3445
Files:
include/clang/AST/DeclTemplate.h
include/clang/Sema/Sema.h
include/clang/Sema/Template.h
lib/AST/DeclTemplate.cpp
lib/Sema/SemaDecl.cpp
lib/Sema/SemaTemplate.cpp
lib/Sema/SemaTemplateDeduction.cpp
lib/Sema/SemaTemplateInstantiate.cpp
lib/Sema/SemaTemplateInstantiateDecl.cpp
test/CXX/temp/temp.decls/temp.class.spec/p6.cpp
test/SemaTemplate/member-templates.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D3445.1.patch
Type: text/x-patch
Size: 45478 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140421/232f1d90/attachment.bin>
More information about the cfe-commits
mailing list