diff options
author | Jordan Rose <jordan_rose@apple.com> | 2016-11-02 20:44:07 +0000 |
---|---|---|
committer | Jordan Rose <jordan_rose@apple.com> | 2016-11-02 20:44:07 +0000 |
commit | fb4b957c672e091bfe70b94054d120ca3f50adf7 (patch) | |
tree | e228c4b3bb83d3447b6dbb33ef889cd74ae5fca8 /test/SemaObjCXX | |
parent | 718769f9eacd7298ec4e39cc03b8a325d3458a97 (diff) |
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
Diffstat (limited to 'test/SemaObjCXX')
-rw-r--r-- | test/SemaObjCXX/Inputs/nullability-consistency-1.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/SemaObjCXX/Inputs/nullability-consistency-1.h b/test/SemaObjCXX/Inputs/nullability-consistency-1.h index 6ab48fe0cd..a99f091e0f 100644 --- a/test/SemaObjCXX/Inputs/nullability-consistency-1.h +++ b/test/SemaObjCXX/Inputs/nullability-consistency-1.h @@ -13,5 +13,13 @@ class X { int X:: *memptr; // expected-warning{{member pointer is missing a nullability type specifier}} }; +template <typename T> +struct Typedefs { + typedef T *Base; // no-warning + typedef Base *type; // expected-warning{{pointer is missing a nullability type specifier}} +}; + +Typedefs<int> xx; +Typedefs<void *> yy; |