[clang-tools-extra] [llvm] [clang] [clang] Implement CWG1878 "`operator auto` template" (PR #78103)

2024-01-18 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/78103 >From 522c7dff31a6f63995877674f9f4282ae60f7aaa Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Sun, 14 Jan 2024 19:45:04 +0300 Subject: [PATCH 1/6] [clang] Implement CWG1878 "`operator auto` template" C+

[clang-tools-extra] [llvm] [clang] [clang] Implement CWG1878 "`operator auto` template" (PR #78103)

2024-01-18 Thread via cfe-commits
@@ -11321,9 +11321,20 @@ Decl *Sema::ActOnConversionDeclarator(CXXConversionDecl *Conversion) { << ClassType << ConvType; } - if (FunctionTemplateDecl *ConversionTemplate -= Conversion->getDescribedFunctionTemplate()) + if (FunctionTe

[llvm] [clang-tools-extra] [clang] [clang] Implement CWG1878 "`operator auto` template" (PR #78103)

2024-01-18 Thread via cfe-commits
https://github.com/cor3ntin approved this pull request. LGTM, thanks Feel free to refactor `err_auto_not_allowed` in a separate PR https://github.com/llvm/llvm-project/pull/78103 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llv

[clang-tools-extra] [llvm] [clang] [clang] Implement CWG1878 "`operator auto` template" (PR #78103)

2024-01-18 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/78103 >From 522c7dff31a6f63995877674f9f4282ae60f7aaa Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Sun, 14 Jan 2024 19:45:04 +0300 Subject: [PATCH 1/5] [clang] Implement CWG1878 "`operator auto` template" C+

[clang] [clang] Implement CWG1878 "`operator auto` template" (PR #78103)

2024-01-18 Thread Vlad Serebrennikov via cfe-commits
@@ -11322,9 +11322,22 @@ Decl *Sema::ActOnConversionDeclarator(CXXConversionDecl *Conversion) { << ClassType << ConvType; } - if (FunctionTemplateDecl *ConversionTemplate -= Conversion->getDescribedFunctionTemplate()) + if (FunctionTe

[clang] [clang] Implement CWG1878 "`operator auto` template" (PR #78103)

2024-01-18 Thread Vlad Serebrennikov via cfe-commits
@@ -686,3 +686,19 @@ auto f(auto x) { // cxx14-error {{'auto' not allowed in function prototype}} } } + +struct DeducedTargetTypeOfConversionFunction { + operator auto() const { return char(); } + operator const auto() const { return float(); } Endilll wrot

[clang] [clang] Implement CWG1878 "`operator auto` template" (PR #78103)

2024-01-18 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/78103 >From 522c7dff31a6f63995877674f9f4282ae60f7aaa Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Sun, 14 Jan 2024 19:45:04 +0300 Subject: [PATCH 1/4] [clang] Implement CWG1878 "`operator auto` template" C+

[clang] [clang] Implement CWG1878 "`operator auto` template" (PR #78103)

2024-01-15 Thread via cfe-commits
@@ -11322,9 +11322,22 @@ Decl *Sema::ActOnConversionDeclarator(CXXConversionDecl *Conversion) { << ClassType << ConvType; } - if (FunctionTemplateDecl *ConversionTemplate -= Conversion->getDescribedFunctionTemplate()) + if (FunctionTe

[clang] [clang] Implement CWG1878 "`operator auto` template" (PR #78103)

2024-01-14 Thread Vlad Serebrennikov via cfe-commits
@@ -11322,9 +11322,22 @@ Decl *Sema::ActOnConversionDeclarator(CXXConversionDecl *Conversion) { << ClassType << ConvType; } - if (FunctionTemplateDecl *ConversionTemplate -= Conversion->getDescribedFunctionTemplate()) + if (FunctionTe

[clang] [clang] Implement CWG1878 "`operator auto` template" (PR #78103)

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

[clang] [clang] Implement CWG1878 "`operator auto` template" (PR #78103)

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

[clang] [clang] Implement CWG1878 "`operator auto` template" (PR #78103)

2024-01-14 Thread via cfe-commits
@@ -11322,9 +11322,22 @@ Decl *Sema::ActOnConversionDeclarator(CXXConversionDecl *Conversion) { << ClassType << ConvType; } - if (FunctionTemplateDecl *ConversionTemplate -= Conversion->getDescribedFunctionTemplate()) + if (FunctionTe

[clang] [clang] Implement CWG1878 "`operator auto` template" (PR #78103)

2024-01-14 Thread via cfe-commits
@@ -11322,9 +11322,22 @@ Decl *Sema::ActOnConversionDeclarator(CXXConversionDecl *Conversion) { << ClassType << ConvType; } - if (FunctionTemplateDecl *ConversionTemplate -= Conversion->getDescribedFunctionTemplate()) + if (FunctionTe

[clang] [clang] Implement CWG1878 "`operator auto` template" (PR #78103)

2024-01-14 Thread via cfe-commits
@@ -686,3 +686,19 @@ auto f(auto x) { // cxx14-error {{'auto' not allowed in function prototype}} } } + +struct DeducedTargetTypeOfConversionFunction { + operator auto() const { return char(); } + operator const auto() const { return float(); } cor3ntin wro

[clang] [clang] Implement CWG1878 "`operator auto` template" (PR #78103)

2024-01-14 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/78103 >From 522c7dff31a6f63995877674f9f4282ae60f7aaa Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Sun, 14 Jan 2024 19:45:04 +0300 Subject: [PATCH 1/2] [clang] Implement CWG1878 "`operator auto` template" C+

[clang] [clang] Implement CWG1878 "`operator auto` template" (PR #78103)

2024-01-14 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 fb2cc9b9fc5ae5a544e3009ae153f5ae83c5a89c 522c7dff31a6f63995877674f9f4282ae60f7aaa --

[clang] [clang] Implement CWG1878 "`operator auto` template" (PR #78103)

2024-01-14 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Vlad Serebrennikov (Endilll) Changes C++14 introduced deduced return type for regular functions, but shortly after [CWG1878](https://wg21.link/cwg1878) was filed and resolved to disallow deduced return types in conversion function templat

[clang] [clang] Implement CWG1878 "`operator auto` template" (PR #78103)

2024-01-14 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll created https://github.com/llvm/llvm-project/pull/78103 C++14 introduced deduced return type for regular functions, but shortly after [CWG1878](https://wg21.link/cwg1878) was filed and resolved to disallow deduced return types in conversion function templates. So thi