[PATCH] D76504: [clang] Fix crash during template sema checking
    Guillaume Chatelet via Phabricator via cfe-commits 
    cfe-commits at lists.llvm.org
       
    Fri Mar 20 09:44:38 PDT 2020
    
    
  
gchatelet added inline comments.
================
Comment at: clang/lib/Sema/SemaChecking.cpp:1655
+    clang::Expr *SizeOp = TheCall->getArg(2);
+    // If any arg is instantiation dependent we bail out.
+    if (DstOp->isInstantiationDependent() ||
----------------
courbet wrote:
> Are the first two necessary ? IIRC only `EvaluateKnownConstInt()` does not like template-dependent stuff. 
That's right I don't think it's realistic to pass the pointers as template parameters so whatever `CheckNonNullArgument` is doing it will probably never end up crashing in the same way.
I'll limit the fix to `SizeOp` then.
Repository:
  rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D76504/new/
https://reviews.llvm.org/D76504
    
    
More information about the cfe-commits
mailing list