mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-12-03 16:54:27 +08:00
re PR c++/20624 (wrong "control reaches end of non-void function" warning)
2005-08-19 Andrew Pinski <pinskia@physics.uc.edu> PR middle-end/20624 * g++.dg/warn/Wreturn-3.C: New test 2005-08-19 Andrew Pinski <pinskia@physics.uc.edu> PR middle-end/20624 * gimple-low.c (block_may_fallthru): Handle CLEANUP_POINT_EXPR by looking past it. From-SVN: r103268
This commit is contained in:
parent
c0975bc705
commit
1581a9a177
@ -1,3 +1,9 @@
|
||||
2005-08-19 Andrew Pinski <pinskia@physics.uc.edu>
|
||||
|
||||
PR middle-end/20624
|
||||
* gimple-low.c (block_may_fallthru): Handle CLEANUP_POINT_EXPR by
|
||||
looking past it.
|
||||
|
||||
2005-08-18 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
|
||||
|
||||
* collect2.c (dup2): Delete.
|
||||
|
@ -368,6 +368,9 @@ block_may_fallthru (tree block)
|
||||
case CALL_EXPR:
|
||||
/* Functions that do not return do not fall through. */
|
||||
return (call_expr_flags (stmt) & ECF_NORETURN) == 0;
|
||||
|
||||
case CLEANUP_POINT_EXPR:
|
||||
return block_may_fallthru (TREE_OPERAND (stmt, 0));
|
||||
|
||||
default:
|
||||
return true;
|
||||
|
@ -1,3 +1,8 @@
|
||||
2005-08-19 Andrew Pinski <pinskia@physics.uc.edu>
|
||||
|
||||
PR middle-end/20624
|
||||
* g++.dg/warn/Wreturn-3.C: New test
|
||||
|
||||
2005-08-18 Dorit Nuzman <dorit@il.ibm.com>
|
||||
|
||||
PR tree-optimization/22228
|
||||
|
18
gcc/testsuite/g++.dg/warn/Wreturn-3.C
Normal file
18
gcc/testsuite/g++.dg/warn/Wreturn-3.C
Normal file
@ -0,0 +1,18 @@
|
||||
// { dg-options "-Wreturn-type" }
|
||||
// PR c++/20624
|
||||
|
||||
struct fpos {
|
||||
fpos(int __pos) {}
|
||||
};
|
||||
struct g {
|
||||
g();
|
||||
~g();
|
||||
};
|
||||
fpos seekoff(int b, int c)
|
||||
{
|
||||
g __buf;
|
||||
if (b != -1 && c >= 0)
|
||||
return fpos(-1);
|
||||
else
|
||||
return fpos(-1);
|
||||
}
|
Loading…
Reference in New Issue
Block a user