aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaTemplate.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-05-03 17:18:57 +0000
committerDouglas Gregor <dgregor@apple.com>2009-05-03 17:18:57 +0000
commited4ec8f6d183c247a4528ff846669b02f2326185 (patch)
treebb731ad8a547ba30f08537851f7ee49b930eed8f /lib/Sema/SemaTemplate.cpp
parent578aa64fd162e9b728424e54c5a0a7ec53e7b65a (diff)
One can use "class" and "struct" interchangeably to refer to a class
in C++. Fixes <rdar://problem/6815995>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70784 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplate.cpp')
-rw-r--r--lib/Sema/SemaTemplate.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp
index 43713e11f1..3649abd9a7 100644
--- a/lib/Sema/SemaTemplate.cpp
+++ b/lib/Sema/SemaTemplate.cpp
@@ -461,7 +461,7 @@ Sema::ActOnClassTemplate(Scope *S, unsigned TagSpec, TagKind TK,
// the class-key shall agree in kind with the original class
// template declaration (7.1.5.3).
RecordDecl *PrevRecordDecl = PrevClassTemplate->getTemplatedDecl();
- if (PrevRecordDecl->getTagKind() != Kind) {
+ if (!isAcceptableTagRedeclaration(PrevRecordDecl->getTagKind(), Kind)) {
Diag(KWLoc, diag::err_use_with_wrong_tag)
<< Name
<< CodeModificationHint::CreateReplacement(KWLoc,
@@ -1975,7 +1975,9 @@ Sema::ActOnClassTemplateSpecialization(Scope *S, unsigned TagSpec, TagKind TK,
case DeclSpec::TST_union: Kind = TagDecl::TK_union; break;
case DeclSpec::TST_class: Kind = TagDecl::TK_class; break;
}
- if (ClassTemplate->getTemplatedDecl()->getTagKind() != Kind) {
+ if (!isAcceptableTagRedeclaration(
+ ClassTemplate->getTemplatedDecl()->getTagKind(),
+ Kind)) {
Diag(KWLoc, diag::err_use_with_wrong_tag)
<< ClassTemplate
<< CodeModificationHint::CreateReplacement(KWLoc,