Changeset View
Changeset View
Standalone View
Standalone View
clang/lib/Sema/SemaTemplate.cpp
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
Show First 20 Lines • Show All 1,684 Lines • ▼ Show 20 Lines | if (TUK == TUK_Definition && (!SkipBody || !SkipBody->ShouldSkip)) | ||||
NewClass->startDefinition(); | NewClass->startDefinition(); | ||||
ProcessDeclAttributeList(S, NewClass, Attr); | ProcessDeclAttributeList(S, NewClass, Attr); | ||||
if (PrevClassTemplate) | if (PrevClassTemplate) | ||||
mergeDeclAttributes(NewClass, PrevClassTemplate->getTemplatedDecl()); | mergeDeclAttributes(NewClass, PrevClassTemplate->getTemplatedDecl()); | ||||
AddPushedVisibilityAttribute(NewClass); | AddPushedVisibilityAttribute(NewClass); | ||||
addDefaultGslOwnerPointerAttribute(NewClass); | |||||
gribozavr: It shouldn't be necessary to perform inference here, instead, the attributes should be… | |||||
From what I understand, here the attribute is put on the ClassTemplateDecl. Without this, there would be no attribute to instantiate from? mgehre: From what I understand, here the attribute is put on the `ClassTemplateDecl`. Without this… | |||||
if (TUK != TUK_Friend) { | if (TUK != TUK_Friend) { | ||||
// Per C++ [basic.scope.temp]p2, skip the template parameter scopes. | // Per C++ [basic.scope.temp]p2, skip the template parameter scopes. | ||||
Scope *Outer = S; | Scope *Outer = S; | ||||
while ((Outer->getFlags() & Scope::TemplateParamScope) != 0) | while ((Outer->getFlags() & Scope::TemplateParamScope) != 0) | ||||
Outer = Outer->getParent(); | Outer = Outer->getParent(); | ||||
PushOnScopeChains(NewTemplate, Outer); | PushOnScopeChains(NewTemplate, Outer); | ||||
} else { | } else { | ||||
▲ Show 20 Lines • Show All 8,762 Lines • Show Last 20 Lines |
It shouldn't be necessary to perform inference here, instead, the attributes should be instantiated, see instantiateDependentAlignedAttr in SemaTemplateInstantiateDecl.cpp for an example.