Skip to content

Commit

Permalink
Don't warn in CTFE
Browse files Browse the repository at this point in the history
  • Loading branch information
ntrel committed Sep 11, 2023
1 parent 47243d1 commit 8de952c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/src/dmd/expression.d
Original file line number Diff line number Diff line change
Expand Up @@ -5634,7 +5634,7 @@ extern (C++) final class CastExp : UnaExp
{
// mutable/const -> immutable, const -> mutable can't be lvalue
// allow casting to/from shared as lvalue
if (to.ty != Tsarray && !e1.type.unSharedOf().pointerTo.implicitConvTo(
if (sc && sc.flags & ~SCOPE.ctfe && to.ty != Tsarray && !e1.type.unSharedOf().pointerTo.implicitConvTo(
to.unSharedOf().pointerTo()))
{
setUnsafePreview(sc, global.params.useDIP1000, false, loc,
Expand Down

0 comments on commit 8de952c

Please sign in to comment.