Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove a broken, unused template class #137

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mstorsjo
Copy link

@mstorsjo mstorsjo commented May 7, 2024

Since Clang changes
llvm/llvm-project#84050 and llvm/llvm-project#90152 (upcoming in Clang 19.x), Clang will diagnose member accesses before instantiating C++ templates.

Within the optional_container_property template, this causes errors for the calls to this->Copy() and this->clear(), as there are no corresponding methods within that template class, errors like these:

asdcplib/src/MXF.h:276:12: error: no member named 'Copy' in 'optional_container_property<PropertyType>'
  276 |             this->Copy(rhs.m_property);
      |             ~~~~  ^
asdcplib/src/MXF.h:284:48: error: no member named 'clear' in 'optional_container_property<PropertyType>'
  284 |           void reset(const PropertyType& rhs) { this->clear(); }
      |                                                 ~~~~  ^

This template is unused, and these faulty calls have been present since the class was added in 0291582.

Simply remove the unused template class, to avoid these compiler errors.

This fixes #136.

Since Clang changes
llvm/llvm-project#84050 and
llvm/llvm-project#90152 (upcoming in
Clang 19.x), Clang will diagnose member accesses before instantiating
C++ templates.

Within the optional_container_property template, this causes errors
for the calls to this->Copy() and this->clear(), as there are no
corresponding methods within that template class, errors like these:

    asdcplib/src/MXF.h:276:12: error: no member named 'Copy' in 'optional_container_property<PropertyType>'
      276 |             this->Copy(rhs.m_property);
          |             ~~~~  ^
    asdcplib/src/MXF.h:284:48: error: no member named 'clear' in 'optional_container_property<PropertyType>'
      284 |           void reset(const PropertyType& rhs) { this->clear(); }
          |                                                 ~~~~  ^

This template is unused, and these faulty calls have been present
since the class was added in 0291582.

Simply remove the unused template class, to avoid these compiler
errors.

This fixes cinecert#136.
dheitmueller pushed a commit to LTNGlobal-opensource/vlc-3.0 that referenced this pull request May 24, 2024
The asdcplib code contains a C++ template which refers to member
variables that doesn't exist. Earlier, this hasn't been an issue,
as the C++ template never is instantiated, but current Clang
versions (the upcoming 19.x version) diagnoses such issues already
before the class is instantiated, leading to compilation errors
on the asdcplib code.

This applies cinecert/asdcplib#137 (which
hasn't yet received any attention), fixing
cinecert/asdcplib#136.

(cherry picked from commit c481befc9796ed57606d5fd7cba18449702d4cc2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Compilation fails on broken optional_container_property template with latest Clang
1 participant