[PATCH] D41179: [Sema] Diagnose template specializations with C linkage

2020-08-21 Thread Mikhail Maltsev via Phabricator via cfe-commits
miyuki abandoned this revision. miyuki added a comment. Abandoning in favour of: commit a64883431369f28f3fac311c496a4dfad480058f Author: Richard Smith Date: Wed Jul 29 16:49:05 2020 -0700 PR46729: Reject explicit and par

[PATCH] D41179: [Sema] Diagnose template specializations with C linkage

2018-01-15 Thread Mikhail Maltsev via Phabricator via cfe-commits
miyuki added a comment. ping^2 https://reviews.llvm.org/D41179 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D41179: [Sema] Diagnose template specializations with C linkage

2018-01-08 Thread Mikhail Maltsev via Phabricator via cfe-commits
miyuki added a comment. ping https://reviews.llvm.org/D41179 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D41179: [Sema] Diagnose template specializations with C linkage

2017-12-27 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. In https://reviews.llvm.org/D41179#964526, @faisalv wrote: > In https://reviews.llvm.org/D41179#964522, @miyuki wrote: > > > In https://reviews.llvm.org/D41179#957992, @sepavloff wrote: > > > > > Classes do not have language linkage according to 10.5p1, just as > > >

[PATCH] D41179: [Sema] Diagnose template specializations with C linkage

2017-12-27 Thread Faisal Vali via Phabricator via cfe-commits
faisalv added a comment. In https://reviews.llvm.org/D41179#964522, @miyuki wrote: > In https://reviews.llvm.org/D41179#957992, @sepavloff wrote: > > > Classes do not have language linkage according to 10.5p1, just as > > templates, so this code is valid. > > > > It looks like defining tem

[PATCH] D41179: [Sema] Diagnose template specializations with C linkage

2017-12-27 Thread Mikhail Maltsev via Phabricator via cfe-commits
miyuki added a comment. In https://reviews.llvm.org/D41179#957992, @sepavloff wrote: > Classes do not have language linkage according to 10.5p1, just as > templates, so this code is valid. > > It looks like defining templates inside extern "C" blocks is OK. Currently both Clang and GCC d

[PATCH] D41179: [Sema] Diagnose template specializations with C linkage

2017-12-27 Thread Mikhail Maltsev via Phabricator via cfe-commits
miyuki updated this revision to Diff 128234. miyuki added a comment. Factored out template language linkage check into a separate function https://reviews.llvm.org/D41179 Files: lib/Sema/SemaTemplate.cpp test/SemaTemplate/class-template-spec.cpp test/SemaTemplate/function-template-special

[PATCH] D41179: [Sema] Diagnose template specializations with C linkage

2017-12-17 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. Is it correct to emit error in this case? According to the Standard 10.5p1 "All function types, function names with external linkage, and variable names with external linkage have a language linkage". So templates do not have a language linkage. The next paragraph, wh

[PATCH] D41179: [Sema] Diagnose template specializations with C linkage

2017-12-17 Thread Faisal Vali via Phabricator via cfe-commits
faisalv added inline comments. Comment at: lib/Sema/SemaTemplate.cpp:7029 + } + // C++ [temp.expl.spec]p2: What do you think about factoring this out into a separate function that is then called both from here and CheckTemplateDeclScope (since it is exactly

[PATCH] D41179: [Sema] Diagnose template specializations with C linkage

2017-12-14 Thread Mikhail Maltsev via Phabricator via cfe-commits
miyuki updated this revision to Diff 126915. miyuki added a comment. Added a test for partial specialization. https://reviews.llvm.org/D41179 Files: lib/Sema/SemaTemplate.cpp test/SemaTemplate/class-template-spec.cpp test/SemaTemplate/function-template-specialization.cpp Index: test/Sem

[PATCH] D41179: [Sema] Diagnose template specializations with C linkage

2017-12-13 Thread Roger Ferrer Ibanez via Phabricator via cfe-commits
rogfer01 added inline comments. Comment at: lib/Sema/SemaTemplate.cpp:7021 + // C++ [temp]p6: + // A template, a template explicit specialization, and a class template + // partial specialization shall not have C linkage. miyuki wrote: > rogfer01 wrote: >

[PATCH] D41179: [Sema] Diagnose template specializations with C linkage

2017-12-13 Thread Mikhail Maltsev via Phabricator via cfe-commits
miyuki added inline comments. Comment at: lib/Sema/SemaTemplate.cpp:7021 + // C++ [temp]p6: + // A template, a template explicit specialization, and a class template + // partial specialization shall not have C linkage. rogfer01 wrote: > Can you add a test

[PATCH] D41179: [Sema] Diagnose template specializations with C linkage

2017-12-13 Thread Roger Ferrer Ibanez via Phabricator via cfe-commits
rogfer01 added inline comments. Comment at: lib/Sema/SemaTemplate.cpp:7021 + // C++ [temp]p6: + // A template, a template explicit specialization, and a class template + // partial specialization shall not have C linkage. Can you add a test for a partial s

[PATCH] D41179: [Sema] Diagnose template specializations with C linkage

2017-12-13 Thread Mikhail Maltsev via Phabricator via cfe-commits
miyuki created this revision. miyuki added reviewers: faisalv, rsmith, rogfer01. [Sema] Diagnose template specializations with C linkage According to the C++ standard, templates as well as their specializations cannot have C language linkage. Clang currently does not diagnose function template sp