ChuanqiXu closed this revision.
ChuanqiXu added a comment.
Committed in https://reviews.llvm.org/rG354a597b9f3aad2a6a37518d47351adb99688cd2
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D118034/new/
https://reviews.llvm.org/D118034
___
ChuanqiXu updated this revision to Diff 443124.
ChuanqiXu added a comment.
Minor changes.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D118034/new/
https://reviews.llvm.org/D118034
Files:
clang/include/clang/Basic/DiagnosticSemaKinds.td
clang/include/clang/Sema/Sema.h
ChuanqiXu updated this revision to Diff 443123.
ChuanqiXu added a comment.
Minor changes.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D118034/new/
https://reviews.llvm.org/D118034
Files:
clang/test/Modules/Inputs/redundant-template-default-arg/foo.cppm
ChuanqiXu added a comment.
Given @rsmith and @iains is busy and this revision is relatively small,
innocent and looks good to me, I plan to land this in Friday in case there is
no further comments.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D118034/new/
ChuanqiXu added a reviewer: ilya-biryukov.
ChuanqiXu added a subscriber: ilya-biryukov.
ChuanqiXu added a comment.
Add @ilya-biryukov since he did similar things in
https://reviews.llvm.org/D128921
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D118034/new/
ChuanqiXu added a comment.
@rsmith @iains gentle ping~
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D118034/new/
https://reviews.llvm.org/D118034
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
ChuanqiXu added a comment.
@rsmith @iains ping
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D118034/new/
https://reviews.llvm.org/D118034
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
ChuanqiXu updated this revision to Diff 434415.
ChuanqiXu marked an inline comment as done.
ChuanqiXu added a comment.
Remove unused header ODRHash.h
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D118034/new/
https://reviews.llvm.org/D118034
Files:
ChuanqiXu marked 10 inline comments as done.
ChuanqiXu added inline comments.
Comment at: clang/lib/Sema/SemaTemplate.cpp:2762
SawDefaultArgument = true;
-RedundantDefaultArg = true;
+if (!OldTypeParm->getImportedOwningModule())
+
ChuanqiXu updated this revision to Diff 434411.
ChuanqiXu added a comment.
Address comments.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D118034/new/
https://reviews.llvm.org/D118034
Files:
clang/include/clang/Basic/DiagnosticSemaKinds.td
clang/include/clang/Sema/Sema.h
rsmith added inline comments.
Comment at: clang/lib/Sema/SemaTemplate.cpp:2651
+Expr *DefaultArgumentY = NTTPY->getDefaultArgument()->IgnoreImpCasts();
+ODRHash X, Y;
+X.AddStmt(DefaultArgumentX);
ODR hashing is intended to produce a hash that's
ChuanqiXu added a comment.
@rsmith gentle ping~
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D118034/new/
https://reviews.llvm.org/D118034
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
ChuanqiXu added a comment.
@rsmith gentle ping~
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D118034/new/
https://reviews.llvm.org/D118034
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
ChuanqiXu added a comment.
@urnathan It looks @rsmith is not available this time. Would you like to accept
this one?
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D118034/new/
https://reviews.llvm.org/D118034
___
cfe-commits mailing list
ChuanqiXu added a comment.
Herald added a project: All.
@rsmith gentle ping~
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D118034/new/
https://reviews.llvm.org/D118034
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
urnathan added inline comments.
Comment at: clang/lib/Sema/SemaTemplate.cpp:2658-2682
+Expr::EvalResult EVRX, EVRY;
+if (!DefaultArgumentX->EvaluateAsConstantExpr(EVRX, C) ||
+!DefaultArgumentY->EvaluateAsConstantExpr(EVRY, C))
+ return false;
+
+APValue
ChuanqiXu added inline comments.
Comment at: clang/lib/Sema/SemaTemplate.cpp:2658-2682
+Expr::EvalResult EVRX, EVRY;
+if (!DefaultArgumentX->EvaluateAsConstantExpr(EVRX, C) ||
+!DefaultArgumentY->EvaluateAsConstantExpr(EVRY, C))
+ return false;
+
+
urnathan added inline comments.
Comment at: clang/lib/Sema/SemaTemplate.cpp:2658-2682
+Expr::EvalResult EVRX, EVRY;
+if (!DefaultArgumentX->EvaluateAsConstantExpr(EVRX, C) ||
+!DefaultArgumentY->EvaluateAsConstantExpr(EVRY, C))
+ return false;
+
+APValue
urnathan added inline comments.
Comment at: clang/lib/Sema/SemaTemplate.cpp:2658-2682
+Expr::EvalResult EVRX, EVRY;
+if (!DefaultArgumentX->EvaluateAsConstantExpr(EVRX, C) ||
+!DefaultArgumentY->EvaluateAsConstantExpr(EVRY, C))
+ return false;
+
+APValue
ChuanqiXu added inline comments.
Comment at: clang/lib/Sema/SemaTemplate.cpp:2658-2682
+Expr::EvalResult EVRX, EVRY;
+if (!DefaultArgumentX->EvaluateAsConstantExpr(EVRX, C) ||
+!DefaultArgumentY->EvaluateAsConstantExpr(EVRY, C))
+ return false;
+
+
urnathan added inline comments.
Comment at: clang/lib/Sema/SemaTemplate.cpp:2658-2682
+Expr::EvalResult EVRX, EVRY;
+if (!DefaultArgumentX->EvaluateAsConstantExpr(EVRX, C) ||
+!DefaultArgumentY->EvaluateAsConstantExpr(EVRY, C))
+ return false;
+
+APValue
ChuanqiXu added inline comments.
Comment at: clang/lib/Sema/SemaTemplate.cpp:2658-2682
+Expr::EvalResult EVRX, EVRY;
+if (!DefaultArgumentX->EvaluateAsConstantExpr(EVRX, C) ||
+!DefaultArgumentY->EvaluateAsConstantExpr(EVRY, C))
+ return false;
+
+
ChuanqiXu updated this revision to Diff 409507.
ChuanqiXu added a comment.
Use ODRHash to simplify code.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D118034/new/
https://reviews.llvm.org/D118034
Files:
clang/include/clang/Basic/DiagnosticSemaKinds.td
urnathan added inline comments.
Comment at: clang/lib/Sema/SemaTemplate.cpp:2654-2656
+if (!C.hasSameType(DefaultArgumentX->getType(),
+ DefaultArgumentY->getType()))
+ return false;
Can this ever trigger and the below expression
ChuanqiXu updated this revision to Diff 409157.
ChuanqiXu added a comment.
Address comment to check if the duplicated default template arguments are the
same and add tests to address the negative cases.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D118034/new/
ChuanqiXu planned changes to this revision.
ChuanqiXu added inline comments.
Comment at: clang/lib/Sema/SemaTemplate.cpp:2852
-if (RedundantDefaultArg) {
+if (RedundantDefaultArg && !IsOldParamFromModule) {
// C++ [temp.param]p12:
urnathan
urnathan added inline comments.
Comment at: clang/lib/Sema/SemaTemplate.cpp:2681-2697
+// Variable used to not diagnose redundant default arguments
+// from modules.
+//
+// [basic.def.odr]/13:
+// There can be more than one definition of a
+//
ChuanqiXu created this revision.
ChuanqiXu added reviewers: rsmith, urnathan, aaron.ballman, erichkeane.
ChuanqiXu added a project: clang.
ChuanqiXu requested review of this revision.
Herald added a subscriber: cfe-commits.
See https://github.com/cplusplus/draft/pull/5204 for a detailed
28 matches
Mail list logo