Commit d6221ad4 by Marek Polacek Committed by Marek Polacek

re PR c++/68653 (ICE: in nonnull_arg_p, at tree.c:13853)

	PR c++/68653
	* tree.c (nonnull_arg_p): Allow OFFSET_TYPE.

	* g++.dg/warn/nonnull3.C: New test.

From-SVN: r231200
parent 105b682e
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> 2015-12-02 Nathan Sidwell <nathan@acm.org>
* config/nvptx/nvptx.c (enum nvptx_shuffle_kind): New. Absorb * 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> 2015-12-02 Joseph Myers <joseph@codesourcery.com>
PR c/68162 PR c/68162
......
// 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 }
...@@ -13848,7 +13848,9 @@ nonnull_arg_p (const_tree arg) ...@@ -13848,7 +13848,9 @@ nonnull_arg_p (const_tree arg)
tree t, attrs, fntype; tree t, attrs, fntype;
unsigned HOST_WIDE_INT arg_num; 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. */ /* The static chain decl is always non null. */
if (arg == cfun->static_chain_decl) if (arg == cfun->static_chain_decl)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment