This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/11632] New: -pedantic flag performs a less pedantic type checking


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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

           Summary: -pedantic flag performs a less pedantic type checking
           Product: gcc
           Version: 3.2
            Status: UNCONFIRMED
          Severity: critical
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: giacomo dot govi at cern dot ch
                CC: gcc-bugs at gcc dot gnu dot org

**On linux rh73 + gcc32**

The code following:

# 1 "Test.cpp"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "Test.cpp"
struct TestClass {};
struct DerivClass : public TestClass {};
int main(int, char**) {
  TestClass *t = 0;
  DerivClass* d = t;
  return 0;
}

compiled with the command line

 g++ Test.cpp -pedantic -o upcast_test -save-temps

gives: 
Test.cpp: In function `int main(int, char**)':
Test.cpp:5: warning: invalid conversion from `TestClass*' to `DerivClass*'

g++ Test.cpp -pedantic -w -o upcast_test -save-temps

gives no message at all.

Expected: error message - correct when no -pedantic flaf is used:
Test.cpp: In function `int main(int, char**)':
Test.cpp:5: invalid conversion from `TestClass*' to `DerivClass*'


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]