Skip to content

-Wdeprecated-copy on TCRGBPalette<16>::operator= (colorutils.h:701) — Rule of 5 violation #2725

Closed

Description

@zackees

Summary

-Wdeprecated-copy fires on TCRGBPalette<16>::operator= because the class declares a user-defined copy ctor (or destructor) and relies on the implicitly declared copy-assignment operator, which C++11 deprecated.

warning: implicitly-declared TCRGBPalette<16>::operator=(const TCRGBPalette<16>&) is deprecated [-Wdeprecated-copy]
  lib/FastLED/fl/gfx/colorutils.h:701:20

Why this matters

C++23/26 likely promotes this to a default-on diagnostic. Fires ~472 times across teensy30/31/40/41/teensyLC builds. Cosmetic for now, but it is the canonical "you violated the Rule of 5" indicator and will cause real grief if/when the class gains a non-trivial destructor.

Proposed fix

Make both special members explicit in detail::TCRGBPalette<N>:

TCRGBPalette(const TCRGBPalette&) = default;
TCRGBPalette& operator=(const TCRGBPalette&) = default;
~TCRGBPalette() = default;

CRGBPalette16 already does this at colorutils.h:699-701; mirror it in the base.

Evidence

teensy30 / teensy31 / teensyLC / teensy40 / teensy41 / teensy_octoWS2811 — all flag this; Teensy 4.x logs show ~196 hits per board, cross-run total ~472.

Activity

  1. zackees commented on Jun 4, 2026

    @zackees
    MemberAuthor

    Tracked under fbuild meta-audit: FastLED/fbuild#408

  2. moved this from Triage to Done in FastLED Trackeron Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions