diff options
author | geoffk <geoffk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-03-24 23:33:56 +0000 |
---|---|---|
committer | geoffk <geoffk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-03-24 23:33:56 +0000 |
commit | e34aad8018d6ec094b0673c02427bb3be2928094 (patch) | |
tree | 00f93404319f492515942791b32145492be80b53 /gcc/testsuite/g++.dg/expr | |
parent | 81c8673cd5415fa78cb368369ea3a76e967e2472 (diff) | |
download | gcc-e34aad8018d6ec094b0673c02427bb3be2928094.tar.gz |
Index: cp/ChangeLog
2005-03-24 Geoffrey Keating <geoffk@apple.com>
* typeck.c (build_static_cast_1): Allow scalar_cast between
any integral, floating, or enumeration type.
Index: testsuite/ChangeLog
2005-03-24 Geoffrey Keating <geoffk@apple.com>
* g++.dg/expr/cast3.C: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@97019 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/g++.dg/expr')
-rw-r--r-- | gcc/testsuite/g++.dg/expr/cast3.C | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/expr/cast3.C b/gcc/testsuite/g++.dg/expr/cast3.C new file mode 100644 index 00000000000..2ca56c2698a --- /dev/null +++ b/gcc/testsuite/g++.dg/expr/cast3.C @@ -0,0 +1,22 @@ +// { dg-do compile } + +enum MyState +{ + QUIT = 0, + START, + STOP, + PAUSE +}; + +double GetDouble() +{ + return 1.0; +} + +int main() +{ + MyState the_state; + + the_state = (MyState)GetDouble(); // { dg-bogus "invalid cast" } + return 0; +} |