[llvm-bugs] [Bug 51756] New: ExprMutAnalyzer considers all NoOp-casts for Arguments as 'adding const' and not treating them as mutation
    via llvm-bugs 
    llvm-bugs at lists.llvm.org
       
    Sun Sep  5 08:53:17 PDT 2021
    
    
  
https://bugs.llvm.org/show_bug.cgi?id=51756
            Bug ID: 51756
           Summary: ExprMutAnalyzer considers all NoOp-casts for Arguments
                    as 'adding const' and not treating them as mutation
           Product: clang
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Tooling
          Assignee: unassignedclangbugs at nondot.org
          Reporter: development at jonas-toth.eu
                CC: llvm-bugs at lists.llvm.org
During testing of https://reviews.llvm.org/D54943 a new false positive in the
'ExprMutAnalyzer' was spotted.
Reproducer: https://godbolt.org/z/8EvsM3Eqe
Variables that are passed as arguments to a function are not considered to be
mutated, if there is an implicit cast, that is 'NoOp' (in the assumption that
this is a cast to 'const <ARGTYPE>').
Applying the '__unaligned' attribute introduces such a cast.
This results in the false analysis that this variable is not modified, where in
fact it is.
'ExprMutAnalyzer.cpp, Line 295'
-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210905/6820f575/attachment.html>
    
    
More information about the llvm-bugs
mailing list