summaryrefslogtreecommitdiff
path: root/test/SemaTemplate/dependent-expr.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2013-11-21 01:53:02 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2013-11-21 01:53:02 +0000
commit891be43ecfe67666aebd39922c1fa77149152121 (patch)
treef49eb44c9d30ce8543b90a086e35922bc69b1366 /test/SemaTemplate/dependent-expr.cpp
parentb2dbde5962eb4f3c21c17d18af81a19770f49d94 (diff)
downloadclang-891be43ecfe67666aebd39922c1fa77149152121.tar.gz
PR10837: Warn if a null pointer constant is formed by a zero integer constant
expression that is not a zero literal, in C. This is a different, and more targeted, approach than that in r194540. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@195303 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate/dependent-expr.cpp')
-rw-r--r--test/SemaTemplate/dependent-expr.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/SemaTemplate/dependent-expr.cpp b/test/SemaTemplate/dependent-expr.cpp
index 01ac42ed42..2c26ec53a0 100644
--- a/test/SemaTemplate/dependent-expr.cpp
+++ b/test/SemaTemplate/dependent-expr.cpp
@@ -79,3 +79,17 @@ template<typename T> struct CastDependentIntToPointer {
return ((void*)(((unsigned long)(x)|0x1ul)));
}
};
+
+// Regression test for crasher in r194540.
+namespace PR10837 {
+ typedef void t(int);
+ template<typename> struct A {
+ void f();
+ static t g;
+ };
+ t *p;
+ template<typename T> void A<T>::f() {
+ p = g;
+ }
+ template struct A<int>;
+}