This change caused a new testsuite regression on windows32 targets 

2006-08-01  Volker Reichelt  <[EMAIL PROTECTED]>

        PR c++/28250
        PR c++/28257
        PR c++/28259
        PR c++/28267
        * toplev.c (compile_file): Return early on errorcount or sorrycount.
        * cgraphunit.c (cgraph_finalize_compilation_unit): Likewise.
        (cgraph_optimize): Likewise.

Here:
FAIL: g++.dg/ext/dllimport7.C C++ specific error (test for errors, line 24)

(see eg: <http://gcc.gnu.org/ml/gcc-testresults/2006-08/msg00086.html>

The testcase expects error messages for each of two static data members
that are declared in a dllimport'd class and later defined out of class.


const int Bar::three = 3;       //  { dg-warning "redeclared without dllimport"
}
//  { dg-error "definition of static data" "C++ specific error" { target
i?86-*-cygwin* i?86-*-mingw* } 21 }

const Baz Bar::null_baz;        // { dg-warning "redeclared without dllimport"
}
// { dg-error "definition of static data" "C++ specific error" { target
i?86-*-cygwin* i?86-*-mingw* } 24 } 


only the first "C++-specific error" is emitted, Once errorcount > 0, no
more errors are reported.

Commenting out the early return on errorcount in cgraph_optimize()
restores the expected error message at line 24

The error messages are emitted by winnt-cxx.c:i386_pe_type_dllimport_p(),
a helper routine for targetm.encode_section_info.

Changing the errors to warnings, I get all the messages. The reason they
are errors, rather than warnings is because (1) native MS compiler calls
the definition of a static data member of a dllimport'd class an error and
(2) they usually indicate a silly dll[/im/ex/]port typo in the class
definition or a serious misunderstanding of dllimport semantics.

Danny


-- 
           Summary: [cygwin/mingw32] Missing dllimport  diagnostic
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: dannysmith at users dot sourceforge dot net
        ReportedBy: dannysmith at users dot sourceforge dot net
 GCC build triplet: i386-pc-mingw32
  GCC host triplet: i386-pc-mingw32
GCC target triplet: i386-pc-mingw32


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

Reply via email to