alexfh requested changes to this revision.
alexfh added a comment.
This revision now requires changes to proceed.

The problem with this proposed functionality is that it's not always obvious at 
the call site whether a function is noreturn. exit() may be an easy case, but 
there may be much less obvious names and whether the function is noreturn may 
depend on compile-time configuration or be instantiation-dependent in template 
code (https://godbolt.org/g/fNtpCy):

  template<typename T>
  struct X {
    void f();
  };
  template<>
  struct X<int> {
      [[noreturn]] void f();
  };
  template<typename T>
  void f(int x) {
    if (x) {
      X<T>().f();
    } else {  // Should the check complain here?
      //...
    }
  }


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D41456



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to