diff options
Diffstat (limited to 'gcc/d/dmd/cparse.d')
-rw-r--r-- | gcc/d/dmd/cparse.d | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/d/dmd/cparse.d b/gcc/d/dmd/cparse.d index ad1ad67..d4416ab 100644 --- a/gcc/d/dmd/cparse.d +++ b/gcc/d/dmd/cparse.d @@ -4816,7 +4816,13 @@ final class CParser(AST) : Parser!AST else if (auto tt = t.isTypeTag()) tt.mod |= MODFlags.const_; else - t = t.addSTC(STC.const_); + { + /* Ignore const if the result would be const pointer to mutable + */ + auto tn = t.nextOf(); + if (!tn || tn.isConst()) + t = t.addSTC(STC.const_); + } return t; } |