Skip to content

[flang] Add missing copy constructor #139966

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

Merged
merged 1 commit into from
May 15, 2025

Conversation

ashermancinelli
Copy link
Contributor

@ashermancinelli ashermancinelli commented May 14, 2025

On some compilers the implicit copy constructor assignment operator was issuing a warning.

On some compilers the implicit copy constructor was issuing a
warning.
@ashermancinelli ashermancinelli self-assigned this May 14, 2025
@llvmbot llvmbot added flang Flang issues not falling into any other category flang:semantics labels May 14, 2025
@llvmbot
Copy link
Member

llvmbot commented May 14, 2025

@llvm/pr-subscribers-flang-semantics

Author: Asher Mancinelli (ashermancinelli)

Changes

On some compilers the implicit copy constructor was issuing a warning.


Full diff: https://github.com/llvm/llvm-project/pull/139966.diff

1 Files Affected:

  • (modified) flang/include/flang/Semantics/symbol.h (+1)
diff --git a/flang/include/flang/Semantics/symbol.h b/flang/include/flang/Semantics/symbol.h
index 97c1e30631840..4cded64d170cd 100644
--- a/flang/include/flang/Semantics/symbol.h
+++ b/flang/include/flang/Semantics/symbol.h
@@ -600,6 +600,7 @@ class TypeParamDetails {
 public:
   TypeParamDetails() = default;
   TypeParamDetails(const TypeParamDetails &) = default;
+  TypeParamDetails &operator=(const TypeParamDetails &) = default;
   std::optional<common::TypeParamAttr> attr() const { return attr_; }
   TypeParamDetails &set_attr(common::TypeParamAttr);
   MaybeIntExpr &init() { return init_; }

@klausler
Copy link
Contributor

klausler commented May 14, 2025

On some compilers the implicit copy constructor was issuing a warning.

It's a copy assignment operator. Which compilers complain?

UPDATE: it was clang-17

@ashermancinelli ashermancinelli merged commit ed572aa into llvm:main May 15, 2025
14 checks passed
TIFitis pushed a commit to TIFitis/llvm-project that referenced this pull request May 19, 2025
On Clang 17 the implicit copy assignment operator was issuing a warning because of the user-declared copy constructor. Declare the copy assignment operator as default.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flang:semantics flang Flang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants