cppcheck says trunk.git/gcc/cp/decl.c:10038:7: warning: Either the condition 'attrlist' is redundant or there is possible null pointer dereference: attrlist. [nullPointerRedundantCheck] Source code is decl = check_explicit_specialization (orig_declarator, decl, template_count, 2 * funcdef_flag + 4 * (friendp != 0) + 8 * concept_p, *attrlist); if (decl == error_mark_node) return NULL_TREE; if (DECL_STATIC_FUNCTION_P (decl)) check_static_quals (decl, quals); if (attrlist) { cplus_decl_attributes (&decl, *attrlist, 0); *attrlist = NULL_TREE; } Note how the variable attrlist is used as a pointer, *before* it is later checked. Another possibility is that the final if statement should be if (*attrlist)
It's very hairy code: 037cc9c5dce2 (Fariborz Jahanian 2004-09-23 18:22:25 +0000 10045) if (attrlist) 037cc9c5dce2 (Fariborz Jahanian 2004-09-23 18:22:25 +0000 10046) { 037cc9c5dce2 (Fariborz Jahanian 2004-09-23 18:22:25 +0000 10047) cplus_decl_attributes (&decl, *attrlist, 0); 037cc9c5dce2 (Fariborz Jahanian 2004-09-23 18:22:25 +0000 10048) *attrlist = NULL_TREE; 037cc9c5dce2 (Fariborz Jahanian 2004-09-23 18:22:25 +0000 10049) } 037cc9c5dce2 (Fariborz Jahanian 2004-09-23 18:22:25 +0000 10050) but yes, I think it should be 'if (*attrlist)'.