Gcc 4.1.0 warns about the (ill-fomed?) delete expression on line 5 but fails
to issue a diagnostic for the similar expressions on lines 6 and 7. I would
like to request that it consistently diagnose all such cases.

$ cat t.cpp && gcc -c t.cpp
/*   1 */ int a [1];
/*   2 */ struct S { int a [1]; } s;
/*   3 */ 
/*   4 */ void foo (S *p) {
/*   5 */     delete a;
/*   6 */     delete s.a;
/*   7 */     delete p->a;
/*   8 */ }
t.cpp: In function 'void foo(S*)':
t.cpp:5: warning: deleting array 'int a [1]'


-- 
           Summary: inconsistent warning: deleting array
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: sebor at roguewave dot com
 GCC build triplet: all
  GCC host triplet: all
GCC target triplet: all


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29185

Reply via email to