Custom Query (146 matches)

Filters
 
Or
 
  
 
Columns

Show under each result:


Results (49 - 51 of 146)

Ticket Owner Reporter Resolution Summary
#122 pabuhr fixed Reference assignment
Description

The last line compiles when the RHS type is wrong.

int i = 7;
int & r = i;
int * pi = &r;
int & r3 = &r;

The type of &r is int * allowing the assignment to pi.

In the last line, the initialization puts an implicit & before &r, so the result is address of r, which has type int &, and the assignment is allowed because the types match. But r3 must point to an int, not an int &. I have verified that r3 is pointing at r not i;

#126 Thierry Delisle fixed Pointer assignment with incorrect type not correctly rejected
Description

This code should not compile :

struct Foo {
	int b;
};
struct Bar {
	int a;
	Foo self;
	Foo * other;
};

void Baz(Bar * this) {
	Bar * dst = this->other;
	(void)dst;
}
#142 pabuhr fixed constant expression problem
Description

The following works with gcc but fails with CFA.

struct S {
    int i;
};
enum { X = sizeof(struct S) };
int x[X];

cfa test5.cfa
CFA Version 1.0.0 (debug)
test5.cfa:4:1 error: Non-constexpr in initialization of enumerator: X: const instance of enum __anonymous0 with body 1 with initializer (not constructed)
  Simple Initializer: Generated Cast of:
    Sizeof Expression on: instance of struct S with body 1
  ... to:
    signed int
  ... with environment:
    Types:
    Non-types:
Note: See TracQuery for help on using queries.