https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119511

            Bug ID: 119511
           Summary: Harden 'dg-regexp', fix misuses
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Keywords: internal-improvement
          Severity: normal
          Priority: P3
         Component: testsuite
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tschwinge at gcc dot gnu.org
                CC: dmalcolm at gcc dot gnu.org
  Target Milestone: ---

As far as I can tell, 'dg-regexp' doesn't support the (optional) 'comment',
'selector', 'line' arguments supported with 'dg-warning' (and others), but
doesn't check/diagnose improper number etc. of arguments -- and a number of
'dg-regexp' uses in the test suite appear to use such syntax, such as:

    gcc/testsuite/c-c++-common/Wdangling-pointer-8.c:  p = &x[3];        // {
dg-regexp "\[^\n\r\]+: warning: \[^\n\r\]+ \\\[-Wdangling-pointer.?\\\]"
"message" }

    gcc/testsuite/g++.dg/plugin/diagnostic-test-inlining-1.C:/* { dg-regexp "In
function 'void foo\\(\\)'," "" } */

    gcc/testsuite/g++.dg/warn/Winvalid-memory-model-2.C:/* { dg-regexp "
*inlined from \[^\n\r\]+.C:23:.*" "" { target *-*-* } 0 }

    gcc/testsuite/gcc.dg/Warray-bounds-75.c:// { dg-regexp "In function 'f1',"
"In function f1" { target *-*-* } 0 }

    gcc/testsuite/gcc.dg/Wfree-nonheap-object-5.c:// { dg-regexp "declared
here" "second note on line 24" { target *-*-* } .-3 }

Reply via email to