majnemer added inline comments.
================
Comment at: lib/AST/ASTContext.cpp:8257-8266
@@ -8256,1 +8256,12 @@
+bool ASTContext::containedInUniqueInstantiation(const Decl *D) {
+ const RecordDecl *RD;
+ while ((RD = dyn_cast<RecordDecl>(D->getDeclContext()))) {
+ auto *CTSD = dyn_cast<ClassTemplateSpecializationDecl>(RD);
+ if (CTSD && CTSD->hasAttr<UniqueInstantiationAttr>())
+ return true;
+ D = RD;
+ }
+ return false;
+}
+
----------------
Function templates can contain class templates which contain functions. I
think this code will return false if the outermost function template is the
only one annotated with UniqueInstantiationAttr.
http://reviews.llvm.org/D13330
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits