Skip to content

[AST] Drop const from a return type (NFC) #140665

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

Conversation

kazutakahirata
Copy link
Contributor

No description provided.

@llvmbot llvmbot added clang Clang issues not falling into any other category clang:frontend Language frontend issues, e.g. anything involving "Sema" clang:bytecode Issues for the clang bytecode constexpr interpreter labels May 20, 2025
@llvmbot
Copy link
Member

llvmbot commented May 20, 2025

@llvm/pr-subscribers-clang

Author: Kazu Hirata (kazutakahirata)

Changes

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

2 Files Affected:

  • (modified) clang/lib/AST/ByteCode/Record.cpp (+1-1)
  • (modified) clang/lib/AST/ByteCode/Record.h (+1-1)
diff --git a/clang/lib/AST/ByteCode/Record.cpp b/clang/lib/AST/ByteCode/Record.cpp
index 0c06bec7e5508..1d4ac7103cb76 100644
--- a/clang/lib/AST/ByteCode/Record.cpp
+++ b/clang/lib/AST/ByteCode/Record.cpp
@@ -29,7 +29,7 @@ Record::Record(const RecordDecl *Decl, BaseList &&SrcBases,
     VirtualBaseMap[V.Decl] = &V;
 }
 
-const std::string Record::getName() const {
+std::string Record::getName() const {
   std::string Ret;
   llvm::raw_string_ostream OS(Ret);
   Decl->getNameForDiagnostic(OS, Decl->getASTContext().getPrintingPolicy(),
diff --git a/clang/lib/AST/ByteCode/Record.h b/clang/lib/AST/ByteCode/Record.h
index 686b5dbc431d9..93ca43046180a 100644
--- a/clang/lib/AST/ByteCode/Record.h
+++ b/clang/lib/AST/ByteCode/Record.h
@@ -52,7 +52,7 @@ class Record final {
   /// Returns the underlying declaration.
   const RecordDecl *getDecl() const { return Decl; }
   /// Returns the name of the underlying declaration.
-  const std::string getName() const;
+  std::string getName() const;
   /// Checks if the record is a union.
   bool isUnion() const { return IsUnion; }
   /// Checks if the record is an anonymous union.

@kazutakahirata kazutakahirata merged commit 1fa26ef into llvm:main May 20, 2025
15 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_001_drop_const_clang branch May 20, 2025 04:37
sivan-shani pushed a commit to sivan-shani/llvm-project that referenced this pull request Jun 3, 2025
ajaden-codes pushed a commit to Jaddyen/llvm-project that referenced this pull request Jun 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:bytecode Issues for the clang bytecode constexpr interpreter clang:frontend Language frontend issues, e.g. anything involving "Sema" clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants