af7b990290
* typeck.c (build_static_cast): Don't allow static_casts that cast away constness. (casts_away_constness_r): New function. (casts_away_constness): Likewise. From-SVN: r27128
11 lines
210 B
C
11 lines
210 B
C
// Build don't link:
|
|
// Origin: Mark Mitchell <mark@codesourcery.com>
|
|
|
|
void f() {
|
|
int *i = 0;
|
|
const int *c = 0;
|
|
|
|
static_cast <const int *>(i);
|
|
static_cast <int *>(c); // ERROR - casts away constness
|
|
}
|