Skip to content
Snippets Groups Projects
Commit bb791699 authored by Chandler Carruth's avatar Chandler Carruth
Browse files

Fix a bug where we failed to diagnose class template specialization

uses.

This fixes one of the two remaining failures to implement [[deprecated]]
as specified for C++14.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191572 91177308-0d34-0410-b5e6-96231b3b80d8
parent 86e0468a
No related branches found
No related tags found
Loading
......@@ -2092,6 +2092,9 @@ QualType Sema::CheckTemplateIdType(TemplateName Name,
Decl->setLexicalDeclContext(ClassTemplate->getLexicalDeclContext());
}
// Diagnose uses of this specialization.
(void)DiagnoseUseOfDecl(Decl, TemplateLoc);
CanonType = Context.getTypeDeclType(Decl);
assert(isa<RecordType>(CanonType) &&
"type of non-dependent specialization is not a RecordType");
......
......@@ -19,9 +19,10 @@ enum [[deprecated]] e { E }; // expected-note {{declared here}}
e my_enum; // expected-warning {{'e' is deprecated}}
template <typename T> class X {};
template <> class [[deprecated]] X<int> {};
template <> class [[deprecated]] X<int> {}; // expected-note {{declared here}}
X<char> x1;
X<int> x2; // FIXME: no warning!
// FIXME: The diagnostic here could be much better by mentioning X<int>.
X<int> x2; // expected-warning {{'X' is deprecated}}
template <typename T> class [[deprecated]] X2 {};
template <> class X2<int> {};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment