Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
Root
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
为了安全,强烈建议开启2FA双因子认证:User Settings -> Account -> Enable two-factor authentication!!!
Show more breadcrumbs
cxwx
Root
Commits
ce1c6fc5
Commit
ce1c6fc5
authored
11 years ago
by
Vassil Vassilev
Browse files
Options
Downloads
Patches
Plain Diff
Add clarification comment.
parent
5b06f22e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
interpreter/cling/lib/Interpreter/ASTNodeEraser.cpp
+22
-6
22 additions, 6 deletions
interpreter/cling/lib/Interpreter/ASTNodeEraser.cpp
with
22 additions
and
6 deletions
interpreter/cling/lib/Interpreter/ASTNodeEraser.cpp
+
22
−
6
View file @
ce1c6fc5
...
...
@@ -479,14 +479,30 @@ namespace cling {
}
};
if
(
FD
->
isFunctionTemplateSpecialization
())
{
// 1. Remove the canonical decl.
// TODO: Can the canonical have another DeclContext and Scope, different
// from the specialization's implementation?
FunctionDecl
*
CanFD
=
FD
->
getCanonicalDecl
();
if
(
FD
->
isFunctionTemplateSpecialization
()
&&
FD
->
isCanonicalDecl
())
{
// Only the canonical declarations are registered in the list of the
// specializations.
FunctionTemplateDecl
*
FTD
=
FD
->
getTemplateSpecializationInfo
()
->
getTemplate
();
FunctionTemplateDeclExt
::
removeSpecialization
(
FTD
,
CanFD
);
// The canonical declaration of every specialization is registered with
// the FunctionTemplateDecl.
// Note this might revert too much in the case:
// template<typename T> T f(){ return T();}
// template<> int f();
// template<> int f() { return 0;}
// when the template specialization was forward declared the canonical
// becomes the first forward declaration. If the canonical forward
// declaration was declared outside the set of the decls to revert we have
// to keep it registered as a template specialization.
//
// In order to diagnose mismatches of the specializations, clang 'injects'
// a implicit forward declaration making it very hard distinguish between
// the explicit and the implicit forward declaration. So far the only way
// to distinguish is by source location comparison.
// FIXME: When the misbehavior of clang is fixed we must avoid relying on
// source locations
FunctionDecl
*
canonSpecialization
=
FD
->
getCanonicalDecl
();
FunctionTemplateDeclExt
::
removeSpecialization
(
FTD
,
canonSpecialization
);
}
return
Successful
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment