summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorJordan Rose <jordan_rose@apple.com>2016-11-02 20:44:07 +0000
committerJordan Rose <jordan_rose@apple.com>2016-11-02 20:44:07 +0000
commitce65364afc657318d937ace660afff305817935d (patch)
tree3a4868c58cfba616a97db6cfc7223e6050248169 /clang/test
parent771ef6d4f15452d76387cd66552a38122be60925 (diff)
downloadbcm5719-llvm-ce65364afc657318d937ace660afff305817935d.tar.gz
bcm5719-llvm-ce65364afc657318d937ace660afff305817935d.zip
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. llvm-svn: 285856
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/SemaObjCXX/Inputs/nullability-consistency-1.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/test/SemaObjCXX/Inputs/nullability-consistency-1.h b/clang/test/SemaObjCXX/Inputs/nullability-consistency-1.h
index 6ab48fe0cd8..a99f091e0f2 100644
--- a/clang/test/SemaObjCXX/Inputs/nullability-consistency-1.h
+++ b/clang/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;
OpenPOWER on IntegriCloud