@@ -361,7 +361,7 @@ Sema::ActOnTemplateParameterList(unsigned Depth,
361
361
(Decl**)Params, NumParams, RAngleLoc);
362
362
}
363
363
364
- Sema::DeclTy *
364
+ Sema::DeclResult
365
365
Sema::ActOnClassTemplate (Scope *S, unsigned TagSpec, TagKind TK,
366
366
SourceLocation KWLoc, const CXXScopeSpec &SS,
367
367
IdentifierInfo *Name, SourceLocation NameLoc,
@@ -373,7 +373,7 @@ Sema::ActOnClassTemplate(Scope *S, unsigned TagSpec, TagKind TK,
373
373
374
374
// Check that we can declare a template here.
375
375
if (CheckTemplateDeclScope (S, TemplateParameterLists))
376
- return 0 ;
376
+ return true ;
377
377
378
378
TagDecl::TagKind Kind;
379
379
switch (TagSpec) {
@@ -386,7 +386,7 @@ Sema::ActOnClassTemplate(Scope *S, unsigned TagSpec, TagKind TK,
386
386
// There is no such thing as an unnamed class template.
387
387
if (!Name) {
388
388
Diag (KWLoc, diag::err_template_unnamed_class);
389
- return 0 ;
389
+ return true ;
390
390
}
391
391
392
392
// Find any previous declaration with this name.
@@ -418,7 +418,7 @@ Sema::ActOnClassTemplate(Scope *S, unsigned TagSpec, TagKind TK,
418
418
if (!TemplateParameterListsAreEqual (TemplateParams,
419
419
PrevClassTemplate->getTemplateParameters (),
420
420
/* Complain=*/ true ))
421
- return 0 ;
421
+ return true ;
422
422
423
423
// C++ [temp.class]p4:
424
424
// In a redeclaration, partial specialization, explicit
@@ -429,7 +429,7 @@ Sema::ActOnClassTemplate(Scope *S, unsigned TagSpec, TagKind TK,
429
429
if (PrevRecordDecl->getTagKind () != Kind) {
430
430
Diag (KWLoc, diag::err_use_with_wrong_tag) << Name;
431
431
Diag (PrevRecordDecl->getLocation (), diag::note_previous_use);
432
- return 0 ;
432
+ return true ;
433
433
}
434
434
435
435
@@ -440,7 +440,7 @@ Sema::ActOnClassTemplate(Scope *S, unsigned TagSpec, TagKind TK,
440
440
Diag (Def->getLocation (), diag::note_previous_definition);
441
441
// FIXME: Would it make sense to try to "forget" the previous
442
442
// definition, as part of error recovery?
443
- return 0 ;
443
+ return true ;
444
444
}
445
445
}
446
446
} else if (PrevDecl && PrevDecl->isTemplateParameter ()) {
@@ -456,7 +456,7 @@ Sema::ActOnClassTemplate(Scope *S, unsigned TagSpec, TagKind TK,
456
456
// in (14.5.4).
457
457
Diag (NameLoc, diag::err_redefinition_different_kind) << Name;
458
458
Diag (PrevDecl->getLocation (), diag::note_previous_definition);
459
- return 0 ;
459
+ return true ;
460
460
}
461
461
462
462
// Check the template parameter list of this declaration, possibly
@@ -1767,7 +1767,7 @@ Sema::CheckClassTemplateSpecializationScope(ClassTemplateDecl *ClassTemplate,
1767
1767
return false ;
1768
1768
}
1769
1769
1770
- Sema::DeclTy *
1770
+ Sema::DeclResult
1771
1771
Sema::ActOnClassTemplateSpecialization (Scope *S, unsigned TagSpec, TagKind TK,
1772
1772
SourceLocation KWLoc,
1773
1773
const CXXScopeSpec &SS,
@@ -1783,7 +1783,7 @@ Sema::ActOnClassTemplateSpecialization(Scope *S, unsigned TagSpec, TagKind TK,
1783
1783
ClassTemplateDecl *ClassTemplate
1784
1784
= dyn_cast_or_null<ClassTemplateDecl>(static_cast <Decl *>(TemplateD));
1785
1785
if (!ClassTemplate)
1786
- return 0 ;
1786
+ return true ;
1787
1787
1788
1788
// Check the validity of the template headers that introduce this
1789
1789
// template.
@@ -1796,18 +1796,14 @@ Sema::ActOnClassTemplateSpecialization(Scope *S, unsigned TagSpec, TagKind TK,
1796
1796
else {
1797
1797
TemplateParameterList *TemplateParams
1798
1798
= static_cast <TemplateParameterList*>(*TemplateParameterLists.get ());
1799
- if (TemplateParameterLists.size () > 1 ) {
1800
- Diag (TemplateParams->getTemplateLoc (),
1801
- diag::err_template_spec_extra_headers);
1802
- return 0 ;
1803
- }
1799
+ if (TemplateParameterLists.size () > 1 )
1800
+ return Diag (TemplateParams->getTemplateLoc (),
1801
+ diag::err_template_spec_extra_headers);
1804
1802
1805
- if (TemplateParams->size () > 0 ) {
1803
+ if (TemplateParams->size () > 0 )
1806
1804
// FIXME: No support for class template partial specialization.
1807
- Diag (TemplateParams->getTemplateLoc (),
1808
- diag::unsup_template_partial_spec);
1809
- return 0 ;
1810
- }
1805
+ return Diag (TemplateParams->getTemplateLoc (),
1806
+ diag::unsup_template_partial_spec);
1811
1807
}
1812
1808
1813
1809
// Check that the specialization uses the same tag kind as the
@@ -1836,7 +1832,7 @@ Sema::ActOnClassTemplateSpecialization(Scope *S, unsigned TagSpec, TagKind TK,
1836
1832
if (CheckTemplateArgumentList (ClassTemplate, TemplateNameLoc, LAngleLoc,
1837
1833
&TemplateArgs[0 ], TemplateArgs.size (),
1838
1834
RAngleLoc, ConvertedTemplateArgs))
1839
- return 0 ;
1835
+ return true ;
1840
1836
1841
1837
assert ((ConvertedTemplateArgs.size () ==
1842
1838
ClassTemplate->getTemplateParameters ()->size ()) &&
@@ -1858,7 +1854,7 @@ Sema::ActOnClassTemplateSpecialization(Scope *S, unsigned TagSpec, TagKind TK,
1858
1854
if (CheckClassTemplateSpecializationScope (ClassTemplate, PrevDecl,
1859
1855
TemplateNameLoc,
1860
1856
SS.getRange ()))
1861
- return 0 ;
1857
+ return true ;
1862
1858
1863
1859
if (PrevDecl && PrevDecl->getSpecializationKind () == TSK_Undeclared) {
1864
1860
// Since the only prior class template specialization with these
@@ -1902,7 +1898,7 @@ Sema::ActOnClassTemplateSpecialization(Scope *S, unsigned TagSpec, TagKind TK,
1902
1898
<< Specialization << Range;
1903
1899
Diag (Def->getLocation (), diag::note_previous_definition);
1904
1900
Specialization->setInvalidDecl ();
1905
- return 0 ;
1901
+ return true ;
1906
1902
}
1907
1903
}
1908
1904
0 commit comments