Revert "[LifetimeAnalysis] Support more STL idioms (template forward declaration and DependentNameType)"
This reverts commit r369591, because it causes the formerly-reliable
-Wreturn-stack-address warning to start issuing false positives.
Testcase provided on the commit thread.
llvm-svn: 369677
diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp
index b694c05..2a72f7d 100644
--- a/clang/lib/Sema/SemaDeclAttr.cpp
+++ b/clang/lib/Sema/SemaDeclAttr.cpp
@@ -4592,11 +4592,9 @@
}
return;
}
- for (Decl *Redecl : D->redecls()) {
- Redecl->addAttr(::new (S.Context)
- OwnerAttr(AL.getRange(), S.Context, DerefTypeLoc,
- AL.getAttributeSpellingListIndex()));
- }
+ D->addAttr(::new (S.Context)
+ OwnerAttr(AL.getRange(), S.Context, DerefTypeLoc,
+ AL.getAttributeSpellingListIndex()));
} else {
if (checkAttrMutualExclusion<OwnerAttr>(S, D, AL))
return;
@@ -4611,11 +4609,9 @@
}
return;
}
- for (Decl *Redecl : D->redecls()) {
- Redecl->addAttr(::new (S.Context)
- PointerAttr(AL.getRange(), S.Context, DerefTypeLoc,
- AL.getAttributeSpellingListIndex()));
- }
+ D->addAttr(::new (S.Context)
+ PointerAttr(AL.getRange(), S.Context, DerefTypeLoc,
+ AL.getAttributeSpellingListIndex()));
}
}