[Bug c++/25845] want optional warning for non-constant declarations that could be constant

pcarlini at suse dot de gcc-bugzilla@gcc.gnu.org
Wed Jan 18 16:32:00 GMT 2006



------- Comment #7 from pcarlini at suse dot de  2006-01-18 16:32 -------
(In reply to comment #6)

> int f(const int *a, int *b)
> {
>    *b = 1;
>    return *a;
> }
> 
> a and b can alias and there is no way around that at all because that is
> what the C++ standard says.

Interesting example. But what if the parameters cannot alias (e.g., different
types). What about the other cases mentioned in the PR (probably more important
to me)? No pointers involved at all?


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25845



More information about the Gcc-bugs mailing list