Menu

false positive: returnTempReference

2025-06-09
2025-06-10
  • James K. Lowden

    James K. Lowden - 2025-06-09
    const cdfval_base_t&
    cdfval_base_t::operator()( const YDFLTYPE& loc ) {
      static cdfval_t zero(0);
      return verify_integer(loc, *this) ? *this : zero;
    }
    

    report:

    ../../gcc/cobol/cdf.y:897:37: error: Reference to temporary returned. [returnTempReference]
      return verify_integer(loc, *this) ? *this : zero;
    

    Neither zero nor *this are temporary. cdfval_base_t is the public base class for cdfval_t.

     
  • CHR

    CHR - 2025-06-10

    Can you post a self-contained example that reproduces the error?

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.