ReactOS  0.4.15-dev-1397-g19779b3
noreturn.cpp
Go to the documentation of this file.
1 // Copyright (c) Microsoft. All rights reserved.
2 // Licensed under the MIT license. See LICENSE file in the project root for
3 // full license information.
4 
5 #include <stdio.h>
6 
7 int Count = 0;
8 
9 class A
10 {
11  public:
12  A() { Count++; }
13  ~A() { Count--; }
14 
15  __declspec(noreturn)
16  A(const A &a) { throw 1; }
17 };
18 
19 __declspec(noreturn)
20 int bar(A)
21 {
22  throw 1;
23 }
24 
25 __declspec(noreturn)
26 A foobar()
27 {
28  throw 1;
29 }
30 
31 void foo(const A& a, int i)
32 {
33  A a1 = a;
34  bar(a1);
35 }
36 
37 int main()
38 {
39  try {
40  A a;
41  foo(A(a), bar(a));
42  } catch (int i) {}
43 
44  try {
45  A a;
46  foo(foobar(), bar(a));
47  } catch (int i) {}
48 
49  if (Count == 0)
50  printf("Passed");
51  else
52  printf("FAILED\n");
53 
54 }
A()
Definition: noreturn.cpp:12
__declspec(noreturn) A(const A &a)
Definition: noreturn.cpp:15
void foobar()
Definition: ehthrow.cxx:149
Definition: ehthrow.cxx:92
#define A(row, col)
#define a
Definition: ke_i.h:78
void bar()
Definition: ehthrow.cxx:142
int Count
Definition: noreturn.cpp:7
void foo(const A &a, int i)
Definition: noreturn.cpp:31
int main()
Definition: noreturn.cpp:37
__declspec(noreturn) int bar(A)
Definition: noreturn.cpp:19
~A()
Definition: noreturn.cpp:13
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static const struct update_accum a1
Definition: msg.c:578
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
#define printf
Definition: config.h:203