[clang] [Clang] Add [[clang::no_specializations]] (PR #101469)

2025-01-17 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: Flagging what looks like a bug https://github.com/llvm/llvm-project/pull/101469 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add [[clang::no_specializations]] (PR #101469)

2025-01-17 Thread Shafik Yaghmour via cfe-commits
@@ -1212,6 +1212,14 @@ static void handlePreferredName(Sema &S, Decl *D, const ParsedAttr &AL) { << TT->getDecl(); } +static void handleNoSpecializations(Sema &S, Decl *D, const ParsedAttr &AL) { + StringRef Message; + if (AL.getNumArgs() != 0) +S.checkStringLit

[clang] [Clang] Add [[clang::no_specializations]] (PR #101469)

2025-01-17 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik edited https://github.com/llvm/llvm-project/pull/101469 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add [[clang::no_specializations]] (PR #101469)

2024-11-28 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 closed https://github.com/llvm/llvm-project/pull/101469 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add [[clang::no_specializations]] (PR #101469)

2024-11-27 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/101469 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add [[clang::no_specializations]] (PR #101469)

2024-11-27 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: @AaronBallman @cor3ntin are you happy as well? https://github.com/llvm/llvm-project/pull/101469 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add [[clang::no_specializations]] (PR #101469)

2024-11-26 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/101469 >From 82ab798fc72c6de64ae527d96393f0dc67307e98 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Thu, 1 Aug 2024 12:30:22 +0200 Subject: [PATCH 1/8] [Clang] Add [[clang::diagnose_specializations]] --- cl

[clang] [Clang] Add [[clang::no_specializations]] (PR #101469)

2024-11-26 Thread Nikolas Klauser via cfe-commits
@@ -473,6 +473,7 @@ def ExpansionToDefined : DiagGroup<"expansion-to-defined">; def FlagEnum : DiagGroup<"flag-enum">; def IncrementBool : DiagGroup<"increment-bool", [DeprecatedIncrementBool]>; def InfiniteRecursion : DiagGroup<"infinite-recursion">; +def InvalidSpecialization

[clang] [Clang] Add [[clang::no_specializations]] (PR #101469)

2024-11-25 Thread Erich Keane via cfe-commits
@@ -5445,6 +5445,10 @@ def note_dependent_function_template_spec_discard_reason : Note< "candidate ignored: %select{not a function template|" "not a member of the enclosing %select{class template|" "namespace; did you mean to explicitly qualify the specialization?}1}0">;

[clang] [Clang] Add [[clang::no_specializations]] (PR #101469)

2024-11-25 Thread Erich Keane via cfe-commits
@@ -473,6 +473,7 @@ def ExpansionToDefined : DiagGroup<"expansion-to-defined">; def FlagEnum : DiagGroup<"flag-enum">; def IncrementBool : DiagGroup<"increment-bool", [DeprecatedIncrementBool]>; def InfiniteRecursion : DiagGroup<"infinite-recursion">; +def InvalidSpecialization

[clang] [Clang] Add [[clang::no_specializations]] (PR #101469)

2024-11-25 Thread Nikolas Klauser via cfe-commits
@@ -473,6 +473,7 @@ def ExpansionToDefined : DiagGroup<"expansion-to-defined">; def FlagEnum : DiagGroup<"flag-enum">; def IncrementBool : DiagGroup<"increment-bool", [DeprecatedIncrementBool]>; def InfiniteRecursion : DiagGroup<"infinite-recursion">; +def InvalidSpecialization

[clang] [Clang] Add [[clang::no_specializations]] (PR #101469)

2024-11-25 Thread Erich Keane via cfe-commits
@@ -473,6 +473,7 @@ def ExpansionToDefined : DiagGroup<"expansion-to-defined">; def FlagEnum : DiagGroup<"flag-enum">; def IncrementBool : DiagGroup<"increment-bool", [DeprecatedIncrementBool]>; def InfiniteRecursion : DiagGroup<"infinite-recursion">; +def InvalidSpecialization

[clang] [Clang] Add [[clang::no_specializations]] (PR #101469)

2024-11-25 Thread Erich Keane via cfe-commits
@@ -1155,6 +1155,15 @@ Query for this feature with ``__has_attribute(diagnose_if)``. }]; } +def NoSpecializationsDocs : Documentation { + let Category = DocCatDecl; + let Content = [{ +``[[clang::no_specializations]]`` can be applied to function, class or variable ---

[clang] [Clang] Add [[clang::no_specializations]] (PR #101469)

2024-11-25 Thread Erich Keane via cfe-commits
@@ -4637,7 +4649,7 @@ def HLSLResourceBinding: InheritableAttr { let AdditionalMembers = [{ public: enum class RegisterType : unsigned { SRV, UAV, CBuffer, Sampler, C, I }; - + erichkeane wrote: Please don't commit hte unrelated formatting changes.

[clang] [Clang] Add [[clang::no_specializations]] (PR #101469)

2024-11-25 Thread Erich Keane via cfe-commits
@@ -7197,10 +7206,10 @@ alternatives, though the attribute can be used even when the fix can't be automa and then use the attribute on the original ``baz()`` to help the users update their code to use the new function. -* Attribute attached to fields: The attribute should

[clang] [Clang] Add [[clang::no_specializations]] (PR #101469)

2024-11-25 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. Nits only, otherwise LGTM. https://github.com/llvm/llvm-project/pull/101469 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add [[clang::no_specializations]] (PR #101469)

2024-11-25 Thread Erich Keane via cfe-commits
https://github.com/erichkeane edited https://github.com/llvm/llvm-project/pull/101469 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add [[clang::no_specializations]] (PR #101469)

2024-11-22 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/101469 >From 82ab798fc72c6de64ae527d96393f0dc67307e98 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Thu, 1 Aug 2024 12:30:22 +0200 Subject: [PATCH 1/7] [Clang] Add [[clang::diagnose_specializations]] --- cl

[clang] [Clang] Add [[clang::no_specializations]] (PR #101469)

2024-11-12 Thread Erich Keane via cfe-commits
@@ -981,6 +981,15 @@ Query for this feature with ``__has_attribute(diagnose_if)``. }]; } +def NoSpecializationsDocs : Documentation { + let Category = DocCatDecl; + let Content = [{ +``[[clang::no_specializations]]`` can be applied to class or variable er

[clang] [Clang] Add [[clang::no_specializations]] (PR #101469)

2024-11-12 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: No real comments, other than FunctionTemplate being left out of the documentation. https://github.com/llvm/llvm-project/pull/101469 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org

[clang] [Clang] Add [[clang::no_specializations]] (PR #101469)

2024-11-12 Thread Erich Keane via cfe-commits
https://github.com/erichkeane edited https://github.com/llvm/llvm-project/pull/101469 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add [[clang::no_specializations]] (PR #101469)

2024-11-12 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: > > I went for only adding `[[clang::no_specialization]]` to function > > templates, since the other cases seem even more unlikely to me and seem to > > have a higher implementation complexity. Is that OK? > > Your test coverage also handles class templates and variable templ

[clang] [Clang] Add [[clang::no_specializations]] (PR #101469)

2024-11-12 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > I went for only adding `[[clang::no_specialization]]` to function templates, > since the other cases seem even more unlikely to me and seem to have a higher > implementation complexity. Is that OK? Your test coverage also handles class templates and variable templates in

[clang] [Clang] Add [[clang::no_specializations]] (PR #101469)

2024-11-09 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff bfe486fe764667d514124faf2b39afb7e7322640 5dd5dd4e7a7733412fb20368202c657f97b635a2 --e

[clang] [Clang] Add [[clang::no_specializations]] (PR #101469)

2024-11-09 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: I went for only adding `[[clang::no_specialization]]` to function templates, since the other cases seem even more unlikely to me and seem to have a higher implementation complexity. Is that OK? https://github.com/llvm/llvm-project/pull/101469 _

[clang] [Clang] Add [[clang::no_specializations]] (PR #101469)

2024-11-09 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/101469 >From 82ab798fc72c6de64ae527d96393f0dc67307e98 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Thu, 1 Aug 2024 12:30:22 +0200 Subject: [PATCH 1/6] [Clang] Add [[clang::diagnose_specializations]] --- cl

[clang] [Clang] Add [[clang::no_specializations]] (PR #101469)

2024-08-29 Thread via cfe-commits
cor3ntin wrote: The list is there https://eel.is/c++draft/temp.expl.spec#1 https://github.com/llvm/llvm-project/pull/101469 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add [[clang::no_specializations]] (PR #101469)

2024-08-29 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: > > > > I did think about it more, and I think it would be more consistent to > > > > support the attribute on any sort of specializable entity, including > > > > functions - regardless of STL needs @AaronBallman @ldionne > > > > > > > > > Agreed; if we're adding a custom at

[clang] [Clang] Add [[clang::no_specializations]] (PR #101469)

2024-08-29 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > > > I did think about it more, and I think it would be more consistent to > > > support the attribute on any sort of specializable entity, including > > > functions - regardless of STL needs @AaronBallman @ldionne > > > > > > Agreed; if we're adding a custom attribute, w

[clang] [Clang] Add [[clang::no_specializations]] (PR #101469)

2024-08-29 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: > > I did think about it more, and I think it would be more consistent to > > support the attribute on any sort of specializable entity, including > > functions - regardless of STL needs @AaronBallman @ldionne > > Agreed; if we're adding a custom attribute, we might as well s

[clang] [Clang] Add [[clang::no_specializations]] (PR #101469)

2024-08-29 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > I did think about it more, and I think it would be more consistent to support > the attribute on any sort of specializable entity, including functions - > regardless of STL needs @AaronBallman @ldionne Agreed; if we're adding a custom attribute, we might as well support i

[clang] [Clang] Add [[clang::no_specializations]] (PR #101469)

2024-08-27 Thread via cfe-commits
cor3ntin wrote: I did think about it more, and I think it would be more consistent to support the attribute on any sort of specializable entity, including functions - regardless of STL needs @AaronBallman @ldionne https://github.com/llvm/llvm-project/pull/101469 ___

[clang] [Clang] Add [[clang::no_specializations]] (PR #101469)

2024-08-26 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: > Does it makes sense to also support function templates? For example, my > understanding is that specializing `is_pointer_interconvertible_with_class()` > would be UB I can't find anything explicit about function template specializations, so I'm not 100% sure whether it's a

[clang] [Clang] Add [[clang::no_specializations]] (PR #101469)

2024-08-25 Thread via cfe-commits
cor3ntin wrote: Does it makes sense to also support function templates? For example, my understanding is that specializing `is_pointer_interconvertible_with_class()` would be UB https://github.com/llvm/llvm-project/pull/101469 ___ cfe-commits mailing

[clang] [Clang] Add [[clang::no_specializations]] (PR #101469)

2024-08-25 Thread via cfe-commits
https://github.com/cor3ntin edited https://github.com/llvm/llvm-project/pull/101469 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits