================
@@ -7061,8 +7061,15 @@ NamedDecl *Sema::FindInstantiatedDecl(SourceLocation 
Loc, NamedDecl *D,
     // anonymous unions in class templates).
   }
 
-  if (!ParentDependsOnArgs)
+  if (!ParentDependsOnArgs) {
+    if (auto Found =
+            CurrentInstantiationScope
+                ? CurrentInstantiationScope->getInstantiationOfIfExists(D)
+                : nullptr) {
----------------
Fznamznon wrote:

I find ternary operator inside of an if uncommon, can we simply do

```suggestion
    if (CurrentInstantiationScope) {
      llvm::PointerUnion<... > * Found = 
CurrentInstantiationScope->getInstantiationOfIfExists(D)
      ...
```
and spell out the type?

https://github.com/llvm/llvm-project/pull/165098
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to