[llvm-branch-commits] [clang] PR for llvm/llvm-project#79355 (PR #79361)

2024-01-24 Thread via llvm-branch-commits

https://github.com/github-actions[bot] milestoned 
https://github.com/llvm/llvm-project/pull/79361
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] PR for llvm/llvm-project#79355 (PR #79361)

2024-01-24 Thread via llvm-branch-commits

https://github.com/github-actions[bot] created 
https://github.com/llvm/llvm-project/pull/79361

resolves llvm/llvm-project#79355

>From f99049f248ad367455b07c9db31f1728927b3df1 Mon Sep 17 00:00:00 2001
From: erichkeane 
Date: Wed, 24 Jan 2024 12:07:22 -0800
Subject: [PATCH] Fix comparison of Structural Values

Fixes a regression from #78041 as reported in the review.  The original
patch failed to compare the canonical type, which this adds.  A slightly
modified test of the original report is added.

(cherry picked from commit e3ee3762304aa81e4a240500844bfdd003401b36)
---
 clang/lib/AST/TemplateBase.cpp |  3 ++-
 .../SemaTemplate/temp_arg_nontype_cxx20.cpp| 18 ++
 2 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/clang/lib/AST/TemplateBase.cpp b/clang/lib/AST/TemplateBase.cpp
index 2bdbeb08ef2046..3310d7dc24c59d 100644
--- a/clang/lib/AST/TemplateBase.cpp
+++ b/clang/lib/AST/TemplateBase.cpp
@@ -450,7 +450,8 @@ bool TemplateArgument::structurallyEquals(const 
TemplateArgument &Other) const {
getAsIntegral() == Other.getAsIntegral();
 
   case StructuralValue: {
-if (getStructuralValueType() != Other.getStructuralValueType())
+if (getStructuralValueType().getCanonicalType() !=
+Other.getStructuralValueType().getCanonicalType())
   return false;
 
 llvm::FoldingSetNodeID A, B;
diff --git a/clang/test/SemaTemplate/temp_arg_nontype_cxx20.cpp 
b/clang/test/SemaTemplate/temp_arg_nontype_cxx20.cpp
index b5b8cadc909ce0..834174cdf6a32d 100644
--- a/clang/test/SemaTemplate/temp_arg_nontype_cxx20.cpp
+++ b/clang/test/SemaTemplate/temp_arg_nontype_cxx20.cpp
@@ -336,3 +336,21 @@ template void bar(B b) {
   (b.operator Tbar(), ...);
 }
 }
+
+namespace ReportedRegression1 {
+  const char kt[] = "dummy";
+
+  template 
+class SomeTempl { };
+
+  template 
+class SomeTempl {
+  public:
+int exit_code() const { return 0; }
+};
+
+  int use() {
+SomeTempl dummy;
+return dummy.exit_code();
+  }
+}

___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] PR for llvm/llvm-project#79355 (PR #79361)

2024-01-26 Thread via llvm-branch-commits

https://github.com/llvmbot updated 
https://github.com/llvm/llvm-project/pull/79361

>From ffe93d6f5ca33044d4118dc589571fadf7e2fc81 Mon Sep 17 00:00:00 2001
From: erichkeane 
Date: Wed, 24 Jan 2024 12:07:22 -0800
Subject: [PATCH] Fix comparison of Structural Values

Fixes a regression from #78041 as reported in the review.  The original
patch failed to compare the canonical type, which this adds.  A slightly
modified test of the original report is added.

(cherry picked from commit e3ee3762304aa81e4a240500844bfdd003401b36)
---
 clang/lib/AST/TemplateBase.cpp |  3 ++-
 .../SemaTemplate/temp_arg_nontype_cxx20.cpp| 18 ++
 2 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/clang/lib/AST/TemplateBase.cpp b/clang/lib/AST/TemplateBase.cpp
index 2bdbeb08ef2046..3310d7dc24c59d 100644
--- a/clang/lib/AST/TemplateBase.cpp
+++ b/clang/lib/AST/TemplateBase.cpp
@@ -450,7 +450,8 @@ bool TemplateArgument::structurallyEquals(const 
TemplateArgument &Other) const {
getAsIntegral() == Other.getAsIntegral();
 
   case StructuralValue: {
-if (getStructuralValueType() != Other.getStructuralValueType())
+if (getStructuralValueType().getCanonicalType() !=
+Other.getStructuralValueType().getCanonicalType())
   return false;
 
 llvm::FoldingSetNodeID A, B;
diff --git a/clang/test/SemaTemplate/temp_arg_nontype_cxx20.cpp 
b/clang/test/SemaTemplate/temp_arg_nontype_cxx20.cpp
index b5b8cadc909ce0..834174cdf6a32d 100644
--- a/clang/test/SemaTemplate/temp_arg_nontype_cxx20.cpp
+++ b/clang/test/SemaTemplate/temp_arg_nontype_cxx20.cpp
@@ -336,3 +336,21 @@ template void bar(B b) {
   (b.operator Tbar(), ...);
 }
 }
+
+namespace ReportedRegression1 {
+  const char kt[] = "dummy";
+
+  template 
+class SomeTempl { };
+
+  template 
+class SomeTempl {
+  public:
+int exit_code() const { return 0; }
+};
+
+  int use() {
+SomeTempl dummy;
+return dummy.exit_code();
+  }
+}

___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] PR for llvm/llvm-project#79355 (PR #79361)

2024-01-26 Thread via llvm-branch-commits

llvmbot wrote:




@llvm/pr-subscribers-clang

Author: None (github-actions[bot])


Changes

resolves llvm/llvm-project#79355

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


2 Files Affected:

- (modified) clang/lib/AST/TemplateBase.cpp (+2-1) 
- (modified) clang/test/SemaTemplate/temp_arg_nontype_cxx20.cpp (+18) 


``diff
diff --git a/clang/lib/AST/TemplateBase.cpp b/clang/lib/AST/TemplateBase.cpp
index 2bdbeb08ef20465..3310d7dc24c59d2 100644
--- a/clang/lib/AST/TemplateBase.cpp
+++ b/clang/lib/AST/TemplateBase.cpp
@@ -450,7 +450,8 @@ bool TemplateArgument::structurallyEquals(const 
TemplateArgument &Other) const {
getAsIntegral() == Other.getAsIntegral();
 
   case StructuralValue: {
-if (getStructuralValueType() != Other.getStructuralValueType())
+if (getStructuralValueType().getCanonicalType() !=
+Other.getStructuralValueType().getCanonicalType())
   return false;
 
 llvm::FoldingSetNodeID A, B;
diff --git a/clang/test/SemaTemplate/temp_arg_nontype_cxx20.cpp 
b/clang/test/SemaTemplate/temp_arg_nontype_cxx20.cpp
index b5b8cadc909ce00..834174cdf6a32dc 100644
--- a/clang/test/SemaTemplate/temp_arg_nontype_cxx20.cpp
+++ b/clang/test/SemaTemplate/temp_arg_nontype_cxx20.cpp
@@ -336,3 +336,21 @@ template void bar(B b) {
   (b.operator Tbar(), ...);
 }
 }
+
+namespace ReportedRegression1 {
+  const char kt[] = "dummy";
+
+  template 
+class SomeTempl { };
+
+  template 
+class SomeTempl {
+  public:
+int exit_code() const { return 0; }
+};
+
+  int use() {
+SomeTempl dummy;
+return dummy.exit_code();
+  }
+}

``




https://github.com/llvm/llvm-project/pull/79361
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] PR for llvm/llvm-project#79355 (PR #79361)

2024-01-27 Thread Tom Stellard via llvm-branch-commits

tstellar wrote:

Merged: 16bfe1e89f6bc6c9cf5c584247856840f83fad62

https://github.com/llvm/llvm-project/pull/79361
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] PR for llvm/llvm-project#79355 (PR #79361)

2024-01-27 Thread Tom Stellard via llvm-branch-commits

https://github.com/tstellar closed 
https://github.com/llvm/llvm-project/pull/79361
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits