PR c++/68653
* tree.c (nonnull_arg_p): Allow OFFSET_TYPE.
* g++.dg/warn/nonnull3.C: New test.
From-SVN: r231200
+2015-12-02 Marek Polacek <polacek@redhat.com>
+
+ PR c++/68653
+ * tree.c (nonnull_arg_p): Allow OFFSET_TYPE.
+
2015-12-02 Nathan Sidwell <nathan@acm.org>
* config/nvptx/nvptx.c (enum nvptx_shuffle_kind): New. Absorb
+2015-12-02 Marek Polacek <polacek@redhat.com>
+
+ PR c++/68653
+ * g++.dg/warn/nonnull3.C: New test.
+
2015-12-02 Joseph Myers <joseph@codesourcery.com>
PR c/68162
--- /dev/null
+// PR c++/68653
+// { dg-do compile { target c++11 } }
+// { dg-options "-Wall" }
+
+struct B;
+struct A {
+ template <typename T> __attribute__((nonnull)) bool foo (int T::*);
+ void bar (B *);
+};
+
+template <typename T> bool A::foo (int T::*p)
+{
+ return p;
+}
+void A::bar (B *)
+{
+ foo ((int B::*) nullptr);
+}
+// { dg-warning "nonnull argument" "" {target "*-*-*"} 0 }
tree t, attrs, fntype;
unsigned HOST_WIDE_INT arg_num;
- gcc_assert (TREE_CODE (arg) == PARM_DECL && POINTER_TYPE_P (TREE_TYPE (arg)));
+ gcc_assert (TREE_CODE (arg) == PARM_DECL
+ && (POINTER_TYPE_P (TREE_TYPE (arg))
+ || TREE_CODE (TREE_TYPE (arg)) == OFFSET_TYPE));
/* The static chain decl is always non null. */
if (arg == cfun->static_chain_decl)