Commit 8537dbae by Kaveh R. Ghazi Committed by Roger Sayle

re PR c++/7099 (G++ doesn't set the noreturn attribute on std::exit and std::abort)

2002-07-05  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

        PR c++/7099
        * g++.dg/warn/noreturn1.C: New test.

From-SVN: r55277
parent df061a43
2002-07-05 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
PR c++/7099
* g++.dg/warn/noreturn1.C: New test.
2002-07-03 Mark Mitchell <mark@codesourcery.com>
PR c++/6706
......
// Test that noreturn attributes are properly set.
// Origin: Kaveh Ghazi <ghazi@caip.rutgers.edu> 2002-06-18.
// { dg-do compile }
// { dg-options "-Wall -O2" }
#include <cstdlib>
int foo1 (int i)
{
switch (i)
{
case 1:
case 2:
return i;
}
abort();
}
int foo2 (int i)
{
switch (i)
{
case 1:
case 2:
return i;
}
std::abort();
}
int foo3 (int i)
{
switch (i)
{
case 1:
case 2:
return i;
}
exit(1);
}
int foo4 (int i)
{
switch (i)
{
case 1:
case 2:
return i;
}
std::exit(1);
}
void __attribute__ ((__noreturn__)) foo5 ()
{
abort();
}
void __attribute__ ((__noreturn__)) foo6 ()
{
std::abort();
}
void __attribute__ ((__noreturn__)) foo7 ()
{
exit(1);
}
void __attribute__ ((__noreturn__)) foo8 ()
{
std::exit(1);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment