[clang] [clang-tools-extra] [lldb] [clang] implement CWG1980 and CWG2064: instantiation-dependency improvements (PR #190495)
Oliver Hunt via cfe-commits
cfe-commits at lists.llvm.org
Tue Apr 21 00:48:43 PDT 2026
================
@@ -1991,11 +2003,14 @@ class ASTContext : public RefCountedBase<ASTContext> {
ElaboratedTypeKeyword Keyword, TemplateName T,
ArrayRef<TemplateArgument> CanonicalArgs) const;
+ /// \param Unique Whether to perform uniquing for this type. Generally
+ /// avoided, unless necessary for correctness, because it's very expensive.
----------------
ojhunt wrote:
I feel that a separate `getUniquedTemplateSpecializationType(...)` method might be a better approach - it makes the function semantics clearer (at least to me), but I think it really boils down to whether it would make sense for someone to ask for a uniqued specialization without spelling out the underlying type. e.g. this interface explicitly requires a correct underlying type, or `QualType()`, before specifying the uniquing behavior.
As a reader/reviewer it's also easier to see whether a given call is uniquing or not
https://github.com/llvm/llvm-project/pull/190495
More information about the cfe-commits
mailing list