blob: 7d751f2ded01374b2b47cbb24a0b1f5c5fc14848 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
// PR middle-end/51647
// { dg-do compile }
// { dg-options "-Wall" }
enum PropertyAttributes { NONE = 1 };
enum PropertyType { NORMAL = 0, FIELD = 1 };
class LookupResult;
template <typename T>
struct Handle
{
inline explicit Handle (T *obj) __attribute__ ((always_inline)) {}
inline T *operator-> () const __attribute__ ((always_inline)) { return 0; }
};
struct JSObject
{
bool IsGlobalObject () { return false; }
};
struct Isolate
{
LookupResult *top_lookup_result () { return 0; }
};
struct LookupResult
{
explicit LookupResult (Isolate *isolate) {}
JSObject *holder () { return 0; }
PropertyType type () { return NORMAL; }
};
int
test (LookupResult *lookup)
{
Handle <JSObject> holder (lookup->holder ());
switch (lookup->type ())
{
case NORMAL:
if (holder->IsGlobalObject ())
return 2;
else
return 3;
break;
default:
return 4;
}
} // { dg-bogus "control reaches end of non-void function" }
|