Bug 11632 - -pedantic flag performs a less pedantic type checking
Summary: -pedantic flag performs a less pedantic type checking
Status: RESOLVED DUPLICATE of bug 10032
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 3.2
: P2 critical
Target Milestone: 3.4.0
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-07-22 16:26 UTC by Giacomo Govi
Modified: 2005-07-23 22:49 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Giacomo Govi 2003-07-22 16:26:45 UTC
**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*'
Comment 1 Andrew Pinski 2003-07-22 17:16:35 UTC
This is a dup of bug 10032 which is fixed for 3.3.1 and 3.4. (3.3.1 will be out in the next two 
weeks).

*** This bug has been marked as a duplicate of 10032 ***