]> granicus.if.org Git - clang/commit
Don't require nullability on template parameters in typedefs.
authorJordan Rose <jordan_rose@apple.com>
Wed, 2 Nov 2016 20:44:07 +0000 (20:44 +0000)
committerJordan Rose <jordan_rose@apple.com>
Wed, 2 Nov 2016 20:44:07 +0000 (20:44 +0000)
commitfb4b957c672e091bfe70b94054d120ca3f50adf7
treee228c4b3bb83d3447b6dbb33ef889cd74ae5fca8
parent718769f9eacd7298ec4e39cc03b8a325d3458a97
Don't require nullability on template parameters in typedefs.

Previously the following code would warn on the use of "T":

  template <typename T>
  struct X {
    typedef T *type;
  };

...because nullability is /allowed/ on template parameters (because
they could be pointers). (Actually putting nullability on this use of
'T' will of course break if the argument is a non-pointer type.)

This fix doesn't handle the case where a template parameter is used
/outside/ of a typedef. That seems trickier, especially in parameter
position.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@285856 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/SemaType.cpp
test/SemaObjCXX/Inputs/nullability-consistency-1.h