erichkeane removed rL LLVM as the repository for this revision. erichkeane updated this revision to Diff 80489. erichkeane added a comment.
Corrected single line statement formatting re-squiggly braces. https://reviews.llvm.org/D27486 Files: lib/Sema/SemaTemplate.cpp test/CXX/dcl.dcl/dcl.attr/dcl.attr.deprecated/p1.cpp Index: lib/Sema/SemaTemplate.cpp =================================================================== --- lib/Sema/SemaTemplate.cpp +++ lib/Sema/SemaTemplate.cpp @@ -2352,6 +2352,9 @@ ClassTemplate->getLocation(), ClassTemplate, Converted, nullptr); + if (auto *attr = ClassTemplate->getTemplatedDecl() + ->getAttr<clang::DeprecatedAttr>()) + Decl->addAttr(attr->clone(Context)); ClassTemplate->AddSpecialization(Decl, InsertPos); if (ClassTemplate->isOutOfLine()) Decl->setLexicalDeclContext(ClassTemplate->getLexicalDeclContext()); Index: test/CXX/dcl.dcl/dcl.attr/dcl.attr.deprecated/p1.cpp =================================================================== --- test/CXX/dcl.dcl/dcl.attr/dcl.attr.deprecated/p1.cpp +++ test/CXX/dcl.dcl/dcl.attr/dcl.attr.deprecated/p1.cpp @@ -23,7 +23,8 @@ X<char> x1; X<int> x2; // expected-warning {{'X<int>' is deprecated}} -template <typename T> class [[deprecated]] X2 {}; +template <typename T> class [[deprecated]] X2 {}; //expected-note {{'X2<char>' has been explicitly marked deprecated here}} template <> class X2<int> {}; -X2<char> x3; // FIXME: no warning! -X2<int> x4; +X2<char> x3; // expected-warning {{'X2<char>' is deprecated}} +X2<int> x4; // No warning, the specialization removes it. +
Index: lib/Sema/SemaTemplate.cpp =================================================================== --- lib/Sema/SemaTemplate.cpp +++ lib/Sema/SemaTemplate.cpp @@ -2352,6 +2352,9 @@ ClassTemplate->getLocation(), ClassTemplate, Converted, nullptr); + if (auto *attr = ClassTemplate->getTemplatedDecl() + ->getAttr<clang::DeprecatedAttr>()) + Decl->addAttr(attr->clone(Context)); ClassTemplate->AddSpecialization(Decl, InsertPos); if (ClassTemplate->isOutOfLine()) Decl->setLexicalDeclContext(ClassTemplate->getLexicalDeclContext()); Index: test/CXX/dcl.dcl/dcl.attr/dcl.attr.deprecated/p1.cpp =================================================================== --- test/CXX/dcl.dcl/dcl.attr/dcl.attr.deprecated/p1.cpp +++ test/CXX/dcl.dcl/dcl.attr/dcl.attr.deprecated/p1.cpp @@ -23,7 +23,8 @@ X<char> x1; X<int> x2; // expected-warning {{'X<int>' is deprecated}} -template <typename T> class [[deprecated]] X2 {}; +template <typename T> class [[deprecated]] X2 {}; //expected-note {{'X2<char>' has been explicitly marked deprecated here}} template <> class X2<int> {}; -X2<char> x3; // FIXME: no warning! -X2<int> x4; +X2<char> x3; // expected-warning {{'X2<char>' is deprecated}} +X2<int> x4; // No warning, the specialization removes it. +
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits