r302777 - Reverted r302775

2017-05-11 Thread Serge Pavlov via cfe-commits
Author: sepavloff Date: Thu May 11 03:25:22 2017 New Revision: 302777 URL: http://llvm.org/viewvc/llvm-project?rev=302777&view=rev Log: Reverted r302775 Added: cfe/trunk/test/Driver/arm-darwin-builtin.c - copied unchanged from r302774, cfe/trunk/test/Driver/arm-darwin-builtin.c Modifie

Re: r302777 - Reverted r302775

2017-05-11 Thread Serge Pavlov via cfe-commits
Sorry. I have to investigate a fail in clang-tidy. Thanks, --Serge 2017-05-11 15:43 GMT+07:00 Richard Smith : > When you revert a patch (even one of your own), please say why you > reverted it in the commit message. > > > On 11 May 2017 1:38 am, "Serge Pavlov via cfe-comm

Re: [PATCH] D21508: Make friend function template definition available if class is instantiated.

2016-10-17 Thread Serge Pavlov via cfe-commits
Ping. Thanks, --Serge 2016-10-13 11:51 GMT+07:00 Serge Pavlov : > sepavloff updated the summary for this revision. > > https://reviews.llvm.org/D21508 > > > > ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman

[PATCH] D25816: Use descriptive message if list initializer is incorrectly parenthesized.

2016-10-20 Thread Serge Pavlov via cfe-commits
sepavloff created this revision. sepavloff added a subscriber: cfe-commits. If initializer contains parentheses around braced list where it is not allowed, as in construct `int({0})`, clang issued message like `functional-style cast from 'void' to 'int' is not allowed`, which does not much help.

[PATCH] D25816: Use descriptive message if list initializer is incorrectly parenthesized.

2016-10-21 Thread Serge Pavlov via cfe-commits
sepavloff updated this revision to Diff 75404. sepavloff added a comment. Addressed reviewr's notes. https://reviews.llvm.org/D25816 Files: include/clang/Basic/DiagnosticSemaKinds.td include/clang/Sema/Sema.h lib/Sema/SemaDecl.cpp lib/Sema/SemaExprCXX.cpp test/SemaCXX/cxx0x-initialize

[PATCH] D25816: Use descriptive message if list initializer is incorrectly parenthesized.

2016-10-21 Thread Serge Pavlov via cfe-commits
sepavloff marked 5 inline comments as done. sepavloff added inline comments. Comment at: include/clang/Basic/DiagnosticSemaKinds.td:1762 def err_init_incomplete_type : Error<"initialization of incomplete type %0">; +def err_list_init_in_parens : Error<"list-initializer for non-c

[PATCH] D23765: Fix for clang PR 29087

2016-10-21 Thread Serge Pavlov via cfe-commits
sepavloff added inline comments. Comment at: lib/Sema/SemaExprCXX.cpp:4231 +const CXXConstructorDecl *Constructor = nullptr; +if (const ConstructorUsingShadowDecl *CSD = +dyn_cast(ND)) { Use `auto` here. Type of `CSD` is clear from `dy

Re: [PATCH] D21508: Make friend function template definition available if class is instantiated.

2016-10-24 Thread Serge Pavlov via cfe-commits
Ping. Thanks, --Serge 2016-10-18 0:09 GMT+07:00 Serge Pavlov : > Ping. > > Thanks, > --Serge > > 2016-10-13 11:51 GMT+07:00 Serge Pavlov : > >> sepavloff updated the summary for this revision. >> >> https://reviews.llvm.org/D21508 >> >> >> >> > ___ cfe

[PATCH] D26065: Improve diagnostics if friend function redefines file-level function.

2016-10-27 Thread Serge Pavlov via cfe-commits
sepavloff created this revision. sepavloff added a subscriber: cfe-commits. Clang makes check for function redefinition after it merged the new declaration with the existing one. As a result, it produces poor diagnostics in the case of a friend function defined inline, as in the code: void func

r285543 - Make output of ast-print closer to C++ code

2016-10-30 Thread Serge Pavlov via cfe-commits
Author: sepavloff Date: Mon Oct 31 00:11:12 2016 New Revision: 285543 URL: http://llvm.org/viewvc/llvm-project?rev=285543&view=rev Log: Make output of ast-print closer to C++ code Put semicolon after non-defining method declaration and a class specialization body. Modified: cfe/trunk/lib/AST

[PATCH] D26148: Add missing cases to FunctionDecl::isThisDeclarationADefinition

2016-10-31 Thread Serge Pavlov via cfe-commits
sepavloff created this revision. sepavloff added a subscriber: cfe-commits. This change adds to the method isThisDeclarationADefinition additional conditions under which a function declaration becomes a definition. These includes the case of a declaration that does not have a function body because

[PATCH] D26065: Improve diagnostics if friend function redefines file-level function.

2016-10-31 Thread Serge Pavlov via cfe-commits
sepavloff updated this revision to Diff 76520. sepavloff added a comment. Do not use getFriendObjectKind(), friend kind sometimes is set too late. https://reviews.llvm.org/D26065 Files: lib/Sema/SemaDeclCXX.cpp test/CXX/dcl.dcl/dcl.spec/dcl.fct.spec/p4.cpp Index: test/CXX/dcl.dcl/dcl.spec

[PATCH] D24933: Enable configuration files in clang

2016-11-02 Thread Serge Pavlov via cfe-commits
sepavloff added a comment. Summary of proposal and discussion in mail list. **Problems** The two main problems this feature addresses are: 1. Ability to modify default compiler settings. As an example, the warning `-Wundefined-var-template` can be helpful for people doing module-enabled build

r285882 - Enhancement to test for -ast-print

2016-11-03 Thread Serge Pavlov via cfe-commits
Author: sepavloff Date: Thu Nov 3 02:32:02 2016 New Revision: 285882 URL: http://llvm.org/viewvc/llvm-project?rev=285882&view=rev Log: Enhancement to test for -ast-print Present tests for the functionality provided by command lime option `-ast-print` check only absence of crash. This change trie

r285889 - Reverted r285882 (Enhancement to test for -ast-print)

2016-11-03 Thread Serge Pavlov via cfe-commits
Author: sepavloff Date: Thu Nov 3 03:58:44 2016 New Revision: 285889 URL: http://llvm.org/viewvc/llvm-project?rev=285889&view=rev Log: Reverted r285882 (Enhancement to test for -ast-print) It broke buildbot on Windows. Modified: cfe/trunk/test/Coverage/ast-printing.c Modified: cfe/trunk/te

r285979 - Do not print enum underlying type if language is not C++11

2016-11-03 Thread Serge Pavlov via cfe-commits
Author: sepavloff Date: Fri Nov 4 01:03:34 2016 New Revision: 285979 URL: http://llvm.org/viewvc/llvm-project?rev=285979&view=rev Log: Do not print enum underlying type if language is not C++11 Output generated by option '-ast-print' must not contains enum base type specifications if source lang

r285981 - Enhancement to test for -ast-print

2016-11-03 Thread Serge Pavlov via cfe-commits
Author: sepavloff Date: Fri Nov 4 01:09:23 2016 New Revision: 285981 URL: http://llvm.org/viewvc/llvm-project?rev=285981&view=rev Log: Enhancement to test for -ast-print Present tests for the functionality provided by command lime option `-ast-print` check only absence of crash. This change trie

Re: r285979 - Do not print enum underlying type if language is not C++11

2016-11-04 Thread Serge Pavlov via cfe-commits
This following commit r285981 (Enhancement to test for -ast-print tests) tests this change. Without it the test 'Coverage/ast-printing.c' fails on Windows. Thanks, --Serge 2016-11-04 19:09 GMT+07:00 Aaron Ballman : > On Fri, Nov 4, 2016 at 2:03 AM, Serge Pavlov via cfe-com

[PATCH] D24933: Enable configuration files in clang

2016-11-09 Thread Serge Pavlov via cfe-commits
sepavloff added a comment. > For Chromium, our build system provides a specific Clang version close to > ToT, and obviously what flags to use when invoking it. (Developers can of > course override the flags when configuring if they want.) Now maybe a > developer has a ~/clang.cfg because they w

[PATCH] D26452: Make output of -ast-print a valid C++ code.

2016-11-09 Thread Serge Pavlov via cfe-commits
sepavloff created this revision. sepavloff added reviewers: ABataev, gribozavr, rtrieu. sepavloff added a subscriber: cfe-commits. Output generated by option -ast-print looks like C/C++ code, and it really is for plain C. For C++ the produced output was not valid C++ code, but the differences were

Re: r285543 - Make output of ast-print closer to C++ code

2016-11-09 Thread Serge Pavlov via cfe-commits
m, "Serge Pavlov via cfe-commits" < > cfe-commits@lists.llvm.org> wrote: > >> Author: sepavloff >> Date: Mon Oct 31 00:11:12 2016 >> New Revision: 285543 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=285543&view=rev >> Log: >&

[PATCH] D26452: Make output of -ast-print a valid C++ code.

2016-11-10 Thread Serge Pavlov via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL286439: Make output of -ast-print a valid C++ code. (authored by sepavloff). Changed prior to commit: https://reviews.llvm.org/D26452?vs=77354&id=77452#toc Repository: rL LLVM https://reviews.llvm.o

Re: [PATCH] D23096: [Sema] Pass CombineWithOuterScope = true to constructor of LocalInstantiationScope

2016-11-10 Thread Serge Pavlov via cfe-commits
I don't see any reason why we should adhere particular solution. If you can solve the problem with another approach, please go forward. Thanks, --Serge 2016-11-10 10:12 GMT+07:00 Akira Hatanaka : > ahatanak added a comment. > > Do you think we can transform the Exprs for the uninstantiated defau

[PATCH] D24933: Enable configuration files in clang

2016-11-10 Thread Serge Pavlov via cfe-commits
sepavloff added a comment. >> Default config file is searched for only in the directory where clang >> executable resides. It allows SDK suppliers to customize compiler, for >> instance by turning off unneeded warnings, by providing their own clang.cfg. >> On the other hand developers cannot by

[PATCH] D24933: Enable configuration files in clang

2016-11-10 Thread Serge Pavlov via cfe-commits
sepavloff added a comment. >> Config file set by environment variable is similar to default config file as >> user does not specify anything in command line. But the user must explicitly >> specify the file, it is not made automatically. > > Sorry, I don't understand this part. If a user speci

Re: [PATCH] D25816: Use descriptive message if list initializer is incorrectly parenthesized.

2016-11-10 Thread Serge Pavlov via cfe-commits
Is it OK to commit this patch? Thanks, --Serge 2016-10-21 18:21 GMT+07:00 Alex Lorenz : > arphaman added a subscriber: rsmith. > arphaman added a comment. > > LGTM, I added Richard in case he has something to add. > > > I chose to retain current clang behavior and reject questionable code. > GCC

r286721 - Use descriptive message if list initializer is incorrectly parenthesized.

2016-11-12 Thread Serge Pavlov via cfe-commits
Author: sepavloff Date: Sat Nov 12 09:38:55 2016 New Revision: 286721 URL: http://llvm.org/viewvc/llvm-project?rev=286721&view=rev Log: Use descriptive message if list initializer is incorrectly parenthesized. If initializer contains parentheses around braced list where it is not allowed, as in c

[PATCH] D25816: Use descriptive message if list initializer is incorrectly parenthesized.

2016-11-12 Thread Serge Pavlov via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL286721: Use descriptive message if list initializer is incorrectly parenthesized. (authored by sepavloff). Changed prior to commit: https://reviews.llvm.org/D25816?vs=75404&id=77725#toc Repository: r

Re: [PATCH] D11844: [Modules] More descriptive diagnostics for misplaced import directive

2015-09-14 Thread Serge Pavlov via cfe-commits
sepavloff updated this revision to Diff 34673. sepavloff added a comment. Updated diagnostics according to Sean's notes ('textual module' -> 'textual header') http://reviews.llvm.org/D11844 Files: include/clang/Basic/DiagnosticParseKinds.td include/clang/Basic/DiagnosticSemaKinds.td incl

Re: [PATCH] D11844: [Modules] More descriptive diagnostics for misplaced import directive

2015-09-18 Thread Serge Pavlov via cfe-commits
sepavloff updated this revision to Diff 35115. sepavloff added a comment. Updated patch. http://reviews.llvm.org/D11844 Files: include/clang/Basic/DiagnosticParseKinds.td include/clang/Basic/DiagnosticSemaKinds.td include/clang/Parse/Parser.h include/clang/Sema/Sema.h lib/Parse/ParseD

Re: [PATCH] D11844: [Modules] More descriptive diagnostics for misplaced import directive

2015-09-18 Thread Serge Pavlov via cfe-commits
sepavloff added a comment. Thanks for helpful notes! There are similar cases in Objective C. Should they be implemented in this patch or separate patch is OK? Comment at: include/clang/Basic/DiagnosticParseKinds.td:1016 @@ -1015,2 +1015,3 @@ "expected ';' after module name"

Re: [PATCH] D11844: [Modules] More descriptive diagnostics for misplaced import directive

2015-09-18 Thread Serge Pavlov via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL248085: [Modules] More descriptive diagnostics for misplaced import directive (authored by sepavloff). Changed prior to commit: http://reviews.llvm.org/D11844?vs=35115&id=35161#toc Repository: rL LLV

r248085 - [Modules] More descriptive diagnostics for misplaced import directive

2015-09-18 Thread Serge Pavlov via cfe-commits
Author: sepavloff Date: Sat Sep 19 00:32:57 2015 New Revision: 248085 URL: http://llvm.org/viewvc/llvm-project?rev=248085&view=rev Log: [Modules] More descriptive diagnostics for misplaced import directive If an import directive was put into wrong context, the error message was obscure, complain

Re: [PATCH] D11844: [Modules] More descriptive diagnostics for misplaced import directive

2015-08-11 Thread Serge Pavlov via cfe-commits
sepavloff updated this revision to Diff 31831. sepavloff added a comment. Fixed module boundary treatment. This version must fix problems in the treatment of annot_modulbegin and annot_module_end. Error recover for the token annot_module_include found in wrong context can be made as previously,

Re: [PATCH] D11844: [Modules] More descriptive diagnostics for misplaced import directive

2015-08-13 Thread Serge Pavlov via cfe-commits
sepavloff updated this revision to Diff 32085. sepavloff added a comment. Updated patch Thanks to all for fruitful discussion! The new version tries to addresses review notes. It differs from the previous version in: - Method tryParseMisplacedModuleImport now depends only on current token and

Re: [PATCH] D11194: Instantiate function declarations in instantiated functions.

2015-08-17 Thread Serge Pavlov via cfe-commits
sepavloff updated this revision to Diff 32310. sepavloff added a comment. Updated method isLexicallyWithinFunctionOrMethod according to Richard's notes. http://reviews.llvm.org/D11194 Files: include/clang/AST/DeclBase.h lib/AST/DeclBase.cpp lib/Sema/SemaTemplateInstantiate.cpp lib/Sema/

Re: [PATCH] D11194: Instantiate function declarations in instantiated functions.

2015-08-18 Thread Serge Pavlov via cfe-commits
sepavloff added inline comments. Comment at: lib/AST/DeclBase.cpp:273 @@ +272,3 @@ +return true; + if (const CXXRecordDecl *ClassD = dyn_cast(LDC)) +return ClassD->isLocalClass() && !ClassD->isLambda();; rsmith wrote: > It's not necessary for this change,

Re: [PATCH] D11194: Instantiate function declarations in instantiated functions.

2015-08-19 Thread Serge Pavlov via cfe-commits
sepavloff updated this revision to Diff 32597. sepavloff added a comment. Lambda functions are now treated as local classes. http://reviews.llvm.org/D11194 Files: include/clang/AST/DeclBase.h lib/AST/DeclBase.cpp lib/Sema/SemaTemplateInstantiate.cpp lib/Sema/SemaTemplateInstantiateDecl.

r245810 - Instantiate function declarations in instantiated functions.

2015-08-23 Thread Serge Pavlov via cfe-commits
Author: sepavloff Date: Sun Aug 23 05:22:28 2015 New Revision: 245810 URL: http://llvm.org/viewvc/llvm-project?rev=245810&view=rev Log: Instantiate function declarations in instantiated functions. If a function declaration is found inside a template function as in: template void f() {

Re: [PATCH] D11194: Instantiate function declarations in instantiated functions.

2015-08-23 Thread Serge Pavlov via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL245810: Instantiate function declarations in instantiated functions. (authored by sepavloff). Changed prior to commit: http://reviews.llvm.org/D11194?vs=32597&id=32923#toc Repository: rL LLVM http:/

r245811 - Changes missed from r245810

2015-08-23 Thread Serge Pavlov via cfe-commits
Author: sepavloff Date: Sun Aug 23 06:09:40 2015 New Revision: 245811 URL: http://llvm.org/viewvc/llvm-project?rev=245811&view=rev Log: Changes missed from r245810 Modified: cfe/trunk/lib/AST/DeclBase.cpp Modified: cfe/trunk/lib/AST/DeclBase.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/

[PATCH] D12326: [Modules] Emit warning if module cannot instantiate static class member.

2015-08-25 Thread Serge Pavlov via cfe-commits
sepavloff created this revision. sepavloff added a subscriber: cfe-commits. Instantiation of static class members can be not obvious in some cases. Using modules can cause problems even more difficult to diagnose. PR24425 describes one of such cases. As a way to assist a user, compiler could issue

Re: [PATCH] D11844: [Modules] More descriptive diagnostics for misplaced import directive

2015-08-26 Thread Serge Pavlov via cfe-commits
sepavloff added a subscriber: sepavloff. sepavloff added a comment. Ping. Thanks, --Serge http://reviews.llvm.org/D11844 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D11844: [Modules] More descriptive diagnostics for misplaced import directive

2015-08-26 Thread Serge Pavlov via cfe-commits
Ping. Thanks, --Serge 2015-08-22 3:15 GMT+06:00 Sean Silva : > silvas added inline comments. > > > Comment at: test/Modules/auto-module-import.m:89 > @@ +88,3 @@ > + expected-error {{import of module > 'NoUmbrella.A' appears within function 'includeN

Re: [PATCH] D12326: [Modules] Emit warning if module cannot instantiate static class member.

2015-09-04 Thread Serge Pavlov via cfe-commits
Any feedback? Thanks, --Serge 2015-08-26 0:26 GMT+06:00 Serge Pavlov : > sepavloff created this revision. > sepavloff added a subscriber: cfe-commits. > > Instantiation of static class members can be not obvious in some cases. > Using > modules can cause problems even more difficult to diagnose.

[PATCH] D13987: Postpone module macro update until all headers are parsed.

2015-10-22 Thread Serge Pavlov via cfe-commits
sepavloff created this revision. sepavloff added a subscriber: cfe-commits. This change fixes performance degradation reported in PR24667. The reason of the problem is leaving module after each header, even if the next header is of the same module. With this fix module state record counts the numb

[PATCH] D14224: Added processing of several AST nodes in ASTNodeImporter.

2015-11-02 Thread Serge Pavlov via cfe-commits
sepavloff created this revision. sepavloff added a subscriber: cfe-commits. http://reviews.llvm.org/D14224 Files: lib/AST/ASTImporter.cpp test/ASTMerge/Inputs/class3.cpp test/ASTMerge/Inputs/exprs3.cpp test/ASTMerge/class2.cpp test/ASTMerge/exprs.cpp Index: test/ASTMerge/exprs.cpp

Re: [PATCH] D14286: ASTImporter: expressions, pt.1

2015-11-06 Thread Serge Pavlov via cfe-commits
sepavloff added a comment. The fix must contain tests. Comment at: lib/AST/ASTImporter.cpp:35 @@ +34,3 @@ +void ImportMultipleItems(IIter Ibegin, IIter Iend, OIter Obegin) { + ASTImporter &_Importer = Importer; + std::transform(Ibegin, Iend, Obegin, ---

Re: [PATCH] D14286: ASTImporter: expressions, pt.1

2015-11-08 Thread Serge Pavlov via cfe-commits
2015-11-06 20:28 GMT+06:00 Aleksei Sidorin : > a.sidorin marked 7 inline comments as done. > a.sidorin added a comment. > > Thank you for your comments. I leaved some replies and will update > revision. > Something about lacking tests. > > 1. We cannot check if expression import is correct until w

Re: [PATCH] D14326: ASTImporter: expressions, pt.2

2015-11-09 Thread Serge Pavlov via cfe-commits
sepavloff added a comment. The patch requires tests. For instance, import of CXXBaseSpecifier can be tested along with static_cast: if a class indeed is a base, static_cast will be processed silent, otherwise a message must appear. ArraySubscript could be tested using constexpr function. Materi

[PATCH] D11844: [Modules] More descriptive diagnostics for misplaced import directive

2015-08-07 Thread Serge Pavlov via cfe-commits
sepavloff created this revision. sepavloff added a subscriber: cfe-commits. If an import directive was put into wrong context, the error message was obscure, complaining on misbalanced braces. To get more descriptive messages, annotation tokens related to modules are processed where they must not

Re: [PATCH] D14326: ASTImporter: expressions, pt.2

2016-07-19 Thread Serge Pavlov via cfe-commits
Unit test ImportVAArgExpr fails on Windows. The source file: void declToImport(__builtin_va_list list, ...) { (void)__builtin_va_arg(list, int); } When compiled on Windows it produces AST: TranslationUnitDecl 0x638f150 <> `-FunctionDecl 0x638f780 line:1:6 declToImport 'void (__builtin

Re: [PATCH] D14326: ASTImporter: expressions, pt.2

2016-07-20 Thread Serge Pavlov via cfe-commits
sepavloff added a comment. With this patch unit tests pass on Windows as well. I do not have formal authority to approve patches, but for me the patch is good enough to be accepted. Comment at: lib/AST/ASTImporter.cpp:3422 @@ +3421,3 @@ + D->getTrailingObjects(); + for (i

Re: [PATCH] D16989: Change interpretation of function definition in friend declaration of template class.

2016-07-25 Thread Serge Pavlov via cfe-commits
sepavloff updated this revision to Diff 65376. sepavloff added a comment. Added one more case in shouldLinkDependentDeclWithPrevious https://reviews.llvm.org/D16989 Files: include/clang/Sema/Sema.h lib/Sema/SemaDecl.cpp test/SemaCXX/PR25848.cpp test/SemaCXX/friend2.cpp Index: test/Sema

[PATCH] D23016: Enhance treatment of function specializations in friend declarations

2016-08-01 Thread Serge Pavlov via cfe-commits
sepavloff created this revision. sepavloff added a subscriber: cfe-commits. Function specializations used in friend declarations in class templates, like: ``` template class C1 { friend void func<>(int); ``` previously were processed incorrectly: class instantiation made them ordinary

Re: [PATCH] D23096: [Sema] Pass CombineWithOuterScope = true to constructor of LocalInstantiationScope

2016-08-03 Thread Serge Pavlov via cfe-commits
sepavloff added inline comments. Comment at: test/SemaTemplate/default-expr-arguments-3.cpp:20 @@ +19,2 @@ + } +} Please add the following test to the patch: ``` template void f1() { enum class foo { a, b }; struct S { int g1(foo n = foo::a); }; } temp

r277976 - Pass information in a record instead of stack. NFC

2016-08-07 Thread Serge Pavlov via cfe-commits
Author: sepavloff Date: Sun Aug 7 23:02:15 2016 New Revision: 277976 URL: http://llvm.org/viewvc/llvm-project?rev=277976&view=rev Log: Pass information in a record instead of stack. NFC Functions of Sema that work with building of nested name specifiers have too many parameters (BuildCXXNestedNa

Re: [PATCH] D23016: Enhance treatment of function specializations in friend declarations

2016-08-08 Thread Serge Pavlov via cfe-commits
Ping. Thanks, --Serge 2016-08-01 21:47 GMT+07:00 Serge Pavlov : > sepavloff created this revision. > sepavloff added a subscriber: cfe-commits. > > Function specializations used in friend declarations in class templates, > like: > ``` > template class C1 { > friend void func<>(int);

Re: r266719 - Warn if function or variable cannot be implicitly instantiated

2016-08-09 Thread Serge Pavlov via cfe-commits
Whether enable this warning or not should be determined by user feedback. The warning was implemented to help users in complicated cases that arise in module-enabled builds. It seems however that it makes troubles for other users. Based on feedback on this list I feel that it is better to make this

Re: [PATCH] D15450: Avoid double deletion in Clang driver.

2016-02-01 Thread Serge Pavlov via cfe-commits
sepavloff updated this revision to Diff 46575. sepavloff added a comment. Added regression test. http://reviews.llvm.org/D15450 Files: lib/CodeGen/CodeGenAction.cpp unittests/Frontend/CMakeLists.txt unittests/Frontend/CodeGenActionTest.cpp Index: unittests/Frontend/CodeGenActionTest.cpp

Re: [PATCH] D15450: Avoid double deletion in Clang driver.

2016-02-04 Thread Serge Pavlov via cfe-commits
Any feedback? Thanks, --Serge 2016-02-02 3:31 GMT+06:00 Serge Pavlov : > sepavloff updated this revision to Diff 46575. > sepavloff added a comment. > > Added regression test. > > > http://reviews.llvm.org/D15450 > > Files: > lib/CodeGen/CodeGenAction.cpp > unittests/Frontend/CMakeLists.txt

Re: [PATCH] D15450: Avoid double deletion in Clang driver.

2016-02-04 Thread Serge Pavlov via cfe-commits
sepavloff added a comment. Any feedback? Thanks, --Serge http://reviews.llvm.org/D15450 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D16989: Change interpretation of function definition in friend declaration of template class.

2016-02-08 Thread Serge Pavlov via cfe-commits
sepavloff created this revision. sepavloff added a reviewer: rsmith. sepavloff added a subscriber: cfe-commits. Previously if a file-level function was defined inside befriending template class, it was treated as defined in the code like: ``` void func(int); template class C1 { friend void

Re: [PATCH] D15450: Avoid double deletion in Clang driver.

2016-02-09 Thread Serge Pavlov via cfe-commits
CodeGen action defined in the unit test does not call HandleTranslationUnit, so the hack implemented in `BackendConsumer::HandleTranslationUnit` does not run and clang crashes. With the fix no crash occurs. Thanks, --Serge 2016-02-05 1:17 GMT+06:00 Serge Pavlov : > sepavloff added a comment. > >

Re: [PATCH] D16579: Warn if friend function depends on template parameters.

2016-02-17 Thread Serge Pavlov via cfe-commits
Any feedback? Thanks, --Serge 2016-01-26 20:55 GMT+06:00 Serge Pavlov : > sepavloff created this revision. > sepavloff added a subscriber: cfe-commits. > > Declaration of friend function may depend on template parameters, > however it does not become a template function: > > template class C

Re: [PATCH] D15450: Avoid double deletion in Clang driver.

2016-02-17 Thread Serge Pavlov via cfe-commits
sepavloff added a comment. In http://reviews.llvm.org/D15450#354606, @yaron.keren wrote: > It certainly makes sense to redirect the module request to its owner instead > of duplicating it in a local copy. It is not even a duplication, it is simultaneous sharing by two unique_ptr's. > There ma

r261222 - Avoid double deletion in Clang driver.

2016-02-18 Thread Serge Pavlov via cfe-commits
Author: sepavloff Date: Thu Feb 18 10:42:09 2016 New Revision: 261222 URL: http://llvm.org/viewvc/llvm-project?rev=261222&view=rev Log: Avoid double deletion in Clang driver. Llvm module object is shared between CodeGenerator and BackendConsumer, in both classes it is stored as std::unique_ptr, w

Re: [PATCH] D15450: Avoid double deletion in Clang driver.

2016-02-18 Thread Serge Pavlov via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL261222: Avoid double deletion in Clang driver. (authored by sepavloff). Changed prior to commit: http://reviews.llvm.org/D15450?vs=46575&id=48332#toc Repository: rL LLVM http://reviews.llvm.org/D154

r261223 - File missed from r261222

2016-02-18 Thread Serge Pavlov via cfe-commits
Author: sepavloff Date: Thu Feb 18 10:43:24 2016 New Revision: 261223 URL: http://llvm.org/viewvc/llvm-project?rev=261223&view=rev Log: File missed from r261222 Added: cfe/trunk/unittests/Frontend/CodeGenActionTest.cpp Added: cfe/trunk/unittests/Frontend/CodeGenActionTest.cpp URL: http://ll

r261323 - Removed unused local variable

2016-02-19 Thread Serge Pavlov via cfe-commits
Author: sepavloff Date: Fri Feb 19 06:06:23 2016 New Revision: 261323 URL: http://llvm.org/viewvc/llvm-project?rev=261323&view=rev Log: Removed unused local variable Modified: cfe/trunk/lib/Sema/SemaTemplate.cpp Modified: cfe/trunk/lib/Sema/SemaTemplate.cpp URL: http://llvm.org/viewvc/llvm-

Re: [PATCH] D16579: Warn if friend function depends on template parameters.

2016-02-25 Thread Serge Pavlov via cfe-commits
Could someone provide a feedback? Thanks, --Serge 2016-01-26 20:55 GMT+06:00 Serge Pavlov : > sepavloff created this revision. > sepavloff added a subscriber: cfe-commits. > > Declaration of friend function may depend on template parameters, > however it does not become a template function: > >

Re: [PATCH] D16989: Change interpretation of function definition in friend declaration of template class.

2016-05-03 Thread Serge Pavlov via cfe-commits
sepavloff updated this revision to Diff 56015. sepavloff added a comment. Updated patch. http://reviews.llvm.org/D16989 Files: include/clang/Sema/Sema.h lib/Sema/SemaDecl.cpp test/SemaCXX/PR25848.cpp test/SemaCXX/friend2.cpp Index: test/SemaCXX/friend2.cpp =

Re: [PATCH] D16989: Change interpretation of function definition in friend declaration of template class.

2016-05-03 Thread Serge Pavlov via cfe-commits
2016-04-26 0:55 GMT+06:00 Richard Smith : > rsmith added inline comments. > > > Comment at: lib/Sema/SemaDecl.cpp:8611-8612 > @@ -8609,3 +8610,4 @@ > } else { > - // This needs to happen first so that 'inline' propagates. > - NewFD->setPreviousDeclaration(cast(OldDe

Re: [PATCH] D16579: Warn if friend function depends on template parameters.

2016-05-09 Thread Serge Pavlov via cfe-commits
sepavloff updated this revision to Diff 56607. sepavloff added a comment. Changed implementation of friend function set. Friend functions declared in template classes are not added to redeclaration chains, but access to them is needed to make some checks. This change allows using the set of frie

Re: [PATCH] D16989: Change interpretation of function definition in friend declaration of template class.

2016-05-16 Thread Serge Pavlov via cfe-commits
Any feedback? Thanks, --Serge 2016-05-03 22:40 GMT+06:00 Serge Pavlov : > 2016-04-26 0:55 GMT+06:00 Richard Smith : > >> rsmith added inline comments. >> >> >> Comment at: lib/Sema/SemaDecl.cpp:8611-8612 >> @@ -8609,3 +8610,4 @@ >> } else { >> - // This needs to happen

Re: r266719 - Warn if function or variable cannot be implicitly instantiated

2016-05-19 Thread Serge Pavlov via cfe-commits
In this case moving implementation of `Singleton::getInstance()` into a .cpp file would prevent compiler from instantiation of the method body when it sees `Singleton::getInstance()`. In this case `Singleton::getInstance()` must be instantiated in some source file either explicitly or implicitly. I

Re: [PATCH] D16579: Warn if friend function depends on template parameters.

2016-04-04 Thread Serge Pavlov via cfe-commits
sepavloff updated this revision to Diff 52527. sepavloff added a comment. Updated patch Added a check for presence of template declaration corresponding to the friend function. Presence of similar functions but with specializations as argument types is also checked now. Made an atempt to make me

Re: [PATCH] D16396: Warn if variable cannot be implicitly instantiated

2016-04-13 Thread Serge Pavlov via cfe-commits
sepavloff updated this revision to Diff 53547. sepavloff added a comment. Updated patch according to review notes. The patch adds diagnostics for undefined function templates, in a similar way as for template variables. These two warnings are classified into different groups. Warnings on undefin

Re: [PATCH] D16396: Warn if variable cannot be implicitly instantiated

2016-04-15 Thread Serge Pavlov via cfe-commits
2016-04-14 2:44 GMT+06:00 Richard Smith : > rsmith added a comment. > > I would prefer to avoid adding the `%qt` format if we can. But if we do > provide it, the template parameter names we use should match what was > written in the declaration of the template itself. > > New format was not a good

Re: [PATCH] D16396: Warn if variable cannot be implicitly instantiated

2016-04-15 Thread Serge Pavlov via cfe-commits
sepavloff updated this revision to Diff 53853. sepavloff added a comment. Herald added a subscriber: klimek. Updated patch Get rid of '%qt' format, instead print template parameters always. It requires about 10 tests to be fixed. However printing parameters still can be suppressed, it is required

Re: [PATCH] D16396: Warn if variable cannot be implicitly instantiated

2016-04-18 Thread Serge Pavlov via cfe-commits
sepavloff updated this revision to Diff 54085. sepavloff added a comment. Updated patch Changed text of messages as proposed by reviewer. As a result, printing template parameters is not needed anymore, related code is removed. http://reviews.llvm.org/D16396 Files: include/clang/AST/DeclBase

r266719 - Warn if function or variable cannot be implicitly instantiated

2016-04-18 Thread Serge Pavlov via cfe-commits
Author: sepavloff Date: Tue Apr 19 01:19:52 2016 New Revision: 266719 URL: http://llvm.org/viewvc/llvm-project?rev=266719&view=rev Log: Warn if function or variable cannot be implicitly instantiated With this patch compiler emits warning if it tries to make implicit instantiation of a template b

Re: [PATCH] D16396: Warn if variable cannot be implicitly instantiated

2016-04-18 Thread Serge Pavlov via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL266719: Warn if function or variable cannot be implicitly instantiated (authored by sepavloff). Changed prior to commit: http://reviews.llvm.org/D16396?vs=54085&id=54163#toc Repository: rL LLVM http

Re: r266719 - Warn if function or variable cannot be implicitly instantiated

2016-04-19 Thread Serge Pavlov via cfe-commits
> static LSubKindOperand* Create(int index, Zone* zone) { >> if (index < kNumCachedOperands) return &cache[index]; >> return new(zone) LSubKindOperand(index); >> } >> private: >> static LSubKindOperand* cache; >> explicit LSubKindOperand(int index

Re: [PATCH] D16989: Change interpretation of function definition in friend declaration of template class.

2016-04-20 Thread Serge Pavlov via cfe-commits
2016-03-29 1:08 GMT+06:00 Serge Pavlov : > 2016-03-18 20:50 GMT+06:00 Richard Smith : > >> rsmith added a comment. >> >> Can we instead not add the function to the redeclaration chain until it's >> instantiated (like we do if it's dependent)? >> >> > I prepared implementation that uses this approa

[PATCH] D19336: Repair redeclaration chain of friend template functions.

2016-04-20 Thread Serge Pavlov via cfe-commits
sepavloff created this revision. sepavloff added a reviewer: rsmith. sepavloff added a subscriber: cfe-commits. When friend template function is parsed, it obtains wrong type. For instance, in the code: template void func(T1 *x); template struct C1 { template void func(T1 *x); }; the friend

Re: r266719 - Warn if function or variable cannot be implicitly instantiated

2016-04-21 Thread Serge Pavlov via cfe-commits
Let me demonstrate the problem using excerpt from v8 sources: -- lithium.h template struct LSubKindOperand { static int* Create(int index) { return &cache[index]; } static void SetUpCache(); static int* cache; }; struct LOperand {

Re: [PATCH] D19336: Repair redeclaration chain of friend template functions.

2016-04-25 Thread Serge Pavlov via cfe-commits
2016-04-21 2:57 GMT+06:00 Richard Smith : > rsmith added a comment. > > Sorry, I don't think this approach can work. Consider: > > template struct X { > template friend void f(T); > template friend void f(U); > }; > > These two friend declarations declare different friend function temp

Re: [PATCH] D16989: Change interpretation of function definition in friend declaration of template class.

2016-05-30 Thread Serge Pavlov via cfe-commits
sepavloff updated this revision to Diff 58983. sepavloff added a comment. Updated patch http://reviews.llvm.org/D16989 Files: include/clang/Sema/Sema.h lib/Sema/SemaDecl.cpp test/SemaCXX/PR25848.cpp test/SemaCXX/friend2.cpp Index: test/SemaCXX/friend2.cpp ==

Re: [PATCH] D16989: Change interpretation of function definition in friend declaration of template class.

2016-05-30 Thread Serge Pavlov via cfe-commits
sepavloff marked 2 inline comments as done. sepavloff added a comment. In http://reviews.llvm.org/D16989#432282, @rsmith wrote: > Please also add some testcases for the corresponding case for a friend > function template: > > template void f(); > template struct A { > template void f() {

Re: [PATCH] D14326: ASTImporter: expressions, pt.2

2016-06-01 Thread Serge Pavlov via cfe-commits
sepavloff added inline comments. Comment at: lib/AST/ASTImporter.cpp:2373 @@ +2372,3 @@ + Error = true; +ToInfo = TemplateArgumentLocInfo(TSI); + } else { Maybe `else` before this statement so that in the case of error `ToInfo` remained default initiali

Re: [PATCH] D16989: Change interpretation of function definition in friend declaration of template class.

2016-06-03 Thread Serge Pavlov via cfe-commits
sepavloff updated this revision to Diff 59532. sepavloff added a comment. Fixed test for friend functions. http://reviews.llvm.org/D16989 Files: include/clang/Sema/Sema.h lib/Sema/SemaDecl.cpp test/SemaCXX/PR25848.cpp test/SemaCXX/friend2.cpp Index: test/SemaCXX/friend2.cpp ===

r272366 - Fix recognition of shadowed template parameter

2016-06-09 Thread Serge Pavlov via cfe-commits
Author: sepavloff Date: Thu Jun 9 23:39:07 2016 New Revision: 272366 URL: http://llvm.org/viewvc/llvm-project?rev=272366&view=rev Log: Fix recognition of shadowed template parameter Crash reported in PR28023 is caused by the fact that non-type template parameters are found by tag name lookup. I

[PATCH] D21301: Detect recursive default argument definition

2016-06-13 Thread Serge Pavlov via cfe-commits
sepavloff created this revision. sepavloff added a subscriber: cfe-commits. If definition of default function argument uses itself, clang crashed, because corresponding function parameter is not associated with the default argument yet. With this fix clang emits appropriate error message. This ch

r272623 - Detect recursive default argument definition

2016-06-13 Thread Serge Pavlov via cfe-commits
Author: sepavloff Date: Mon Jun 13 21:55:56 2016 New Revision: 272623 URL: http://llvm.org/viewvc/llvm-project?rev=272623&view=rev Log: Detect recursive default argument definition If definition of default function argument uses itself, clang crashed, because corresponding function parameter is n

Re: [PATCH] D21301: Detect recursive default argument definition

2016-06-13 Thread Serge Pavlov via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL272623: Detect recursive default argument definition (authored by sepavloff). Changed prior to commit: http://reviews.llvm.org/D21301?vs=60564&id=60644#toc Repository: rL LLVM http://reviews.llvm.or

Re: [PATCH] D16989: Change interpretation of function definition in friend declaration of template class.

2016-06-19 Thread Serge Pavlov via cfe-commits
sepavloff updated this revision to Diff 61220. sepavloff added a comment. Updated patch Added handling of FunctionTemplateDecl to shouldLinkDependentDeclWithPrevious. It is not used now but is required for subsequent patch. Also position comment correctly. http://reviews.llvm.org/D16989 Files

[PATCH] D21508: Make friend function template definition available if class is instantiated.

2016-06-19 Thread Serge Pavlov via cfe-commits
sepavloff created this revision. sepavloff added a reviewer: rsmith. sepavloff added a subscriber: cfe-commits. Similar to friend functions, if a friend function template is defined in a class template, its definition is available only if the class is instantiated. http://reviews.llvm.org/D21508

Re: [PATCH] D21508: Make friend function template definition available if class is instantiated.

2016-06-27 Thread Serge Pavlov via cfe-commits
sepavloff updated this revision to Diff 61989. sepavloff added a comment. Make more correct template function definition lookup Lookup is made recursive to cover more cases. http://reviews.llvm.org/D21508 Files: include/clang/AST/DeclTemplate.h lib/AST/DeclTemplate.cpp lib/Sema/SemaDecl.

[PATCH] D21767: Fix instantiation of friend function templates

2016-06-27 Thread Serge Pavlov via cfe-commits
sepavloff created this revision. sepavloff added a reviewer: rsmith. sepavloff added a subscriber: cfe-commits. If a function template was defined in a friend declaration in a template class, it was not instantiated because template definition was not found. http://reviews.llvm.org/D21767 Files:

<    1   2   3   4   5   >