Skip to content
  1. Feb 01, 2019
    • Brian Gesiak's avatar
      [SemaCXX] Param diagnostic matches overload logic · 3aba9fd6
      Brian Gesiak authored
      Summary:
      Given the following test program:
      
      ```
      class C {
      public:
        int A(int a, int& b);
      };
      
      int C::A(const int a, int b) {
        return a * b;
      }
      ```
      
      Clang would produce an error message that correctly diagnosed the
      redeclaration of `C::A` to not match the original declaration (the
      parameters to the two declarations do not match -- the original takes an
      `int &` as its 2nd parameter, but the redeclaration takes an `int`). However,
      it also produced a note diagnostic that inaccurately pointed to the
      first parameter, claiming that `const int` in the redeclaration did not
      match the unqualified `int` in the original. The diagnostic is
      misleading because it has nothing to do with why the program does not
      compile.
      
      The logic for checking for a function overload, in
      `Sema::FunctionParamTypesAreEqual`, discards cv-qualifiers before
      checking whether the types are equal. Do the same when producing the
      overload diagnostic.
      
      Reviewers: rsmith
      
      Reviewed By: rsmith
      
      Subscribers: cpplearner, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D57032
      
      llvm-svn: 352831
      3aba9fd6
    • Julian Lettner's avatar
      [Sanitizers] UBSan unreachable incompatible with ASan in the presence of `noreturn` calls · b6c06dc2
      Julian Lettner authored
      Summary:
      UBSan wants to detect when unreachable code is actually reached, so it
      adds instrumentation before every unreachable instruction. However, the
      optimizer will remove code after calls to functions marked with
      noreturn. To avoid this UBSan removes noreturn from both the call
      instruction as well as from the function itself. Unfortunately, ASan
      relies on this annotation to unpoison the stack by inserting calls to
      _asan_handle_no_return before noreturn functions. This is important for
      functions that do not return but access the the stack memory, e.g.,
      unwinder functions *like* longjmp (longjmp itself is actually
      "double-proofed" via its interceptor). The result is that when ASan and
      UBSan are combined, the noreturn attributes are missing and ASan cannot
      unpoison the stack, so it has false positives when stack unwinding is
      used.
      
      Changes:
      Clang-CodeGen now directly insert calls to `__asan_handle_no_return`
      when a call to a noreturn function is encountered and both
      UBsan-unreachable and ASan are enabled. This allows UBSan to continue
      removing the noreturn attribute from functions without any changes to
      the ASan pass.
      
      Previously generated code:
      ```
        call void @longjmp
        call void @__asan_handle_no_return
        call void @__ubsan_handle_builtin_unreachable
      ```
      
      Generated code (for now):
      ```
        call void @__asan_handle_no_return
        call void @longjmp
        call void @__asan_handle_no_return
        call void @__ubsan_handle_builtin_unreachable
      ```
      
      rdar://problem/40723397
      
      Reviewers: delcypher, eugenis, vsk
      
      Differential Revision: https://reviews.llvm.org/D57278
      
      > llvm-svn: 352690
      
      llvm-svn: 352829
      b6c06dc2
    • George Karpenkov's avatar
      [analyzer] [RetainCountChecker] Fix object type for CF/Obj-C bridged casts · b6c6ab31
      George Karpenkov authored
      Having an incorrect type for a cast causes the checker to incorrectly
      dismiss the operation under ARC, leading to a false positive
      use-after-release on the test.
      
      rdar://47709885
      
      Differential Revision: https://reviews.llvm.org/D57557
      
      llvm-svn: 352824
      b6c6ab31
    • Akira Hatanaka's avatar
      Revert "[Sema] Make canPassInRegisters return true if the CXXRecordDecl passed" · 9e671831
      Akira Hatanaka authored
      This reverts commit r350920 as it is not clear whether we should force a
      class to be returned in registers when copy and move constructors are
      both deleted.
      
      For more background, see the following discussion:
      http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20190128/259907.html
      
      llvm-svn: 352822
      9e671831
  2. Jan 31, 2019
  3. Jan 30, 2019
  4. Jan 29, 2019
Loading