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=245811view=rev Log: Changes missed from r245810 Modified: cfe/trunk/lib/AST/DeclBase.cpp Modified: cfe/trunk/lib/AST/DeclBase.cpp URL:

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=245810view=rev Log: Instantiate function declarations in instantiated functions. If a function declaration is found inside a template function as in: templateclass T 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=32597id=32923#toc Repository: rL LLVM

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

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,

[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

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

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.

[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] 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 chisophu...@gmail.com: silvas added inline comments. Comment at: test/Modules/auto-module-import.m:89 @@ +88,3 @@ + expected-error {{import of module 'NoUmbrella.A' appears within

[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

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

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

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

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

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=rev Log: [Modules] More descriptive diagnostics for misplaced import directive If an import directive was put into wrong context, the error message was obscure, complaining

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=35161#toc Repository: rL LLVM

Re: [PATCH] D15158: [PGO] Instrument only base constructors and destructors.

2015-12-03 Thread Serge Pavlov via cfe-commits
sepavloff updated this revision to Diff 41744. sepavloff added a comment. Changes according to reviewer's notes. http://reviews.llvm.org/D15158 Files: lib/CodeGen/CGBlocks.cpp lib/CodeGen/CGObjC.cpp lib/CodeGen/CGStmt.cpp lib/CodeGen/CGStmtOpenMP.cpp lib/CodeGen/CodeGenFunction.cpp

Re: [PATCH] D15158: [PGO] Instrument only base constructors and destructors.

2015-12-03 Thread Serge Pavlov via cfe-commits
Thank you, Justin. 2015-12-03 5:37 GMT+06:00 Justin Bogner : > Serge Pavlov writes: > > sepavloff created this revision. > > sepavloff added a reviewer: bogner. > > sepavloff added subscribers: cfe-commits, silvas. > > > > Constructors and destructors

r254876 - [PGO] Instrument only base constructors and destructors.

2015-12-06 Thread Serge Pavlov via cfe-commits
Author: sepavloff Date: Sun Dec 6 08:32:39 2015 New Revision: 254876 URL: http://llvm.org/viewvc/llvm-project?rev=254876=rev Log: [PGO] Instrument only base constructors and destructors. Constructors and destructors may be represented by several functions in IR. Only base structors correspond

Re: [PATCH] D15158: [PGO] Instrument only base constructors and destructors.

2015-12-06 Thread Serge Pavlov via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL254876: [PGO] Instrument only base constructors and destructors. (authored by sepavloff). Changed prior to commit: http://reviews.llvm.org/D15158?vs=41744=42011#toc Repository: rL LLVM

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

2015-12-11 Thread Serge Pavlov via cfe-commits
sepavloff created this revision. sepavloff added a subscriber: cfe-commits. Llvm module object is shared between CodeGenerator and BackendConsumer, in both classes it is stored as std::unique_ptr, which is not a good design solution and can cause double deletion error. Usually it does not occur

r256503 - Avoid crash when dumping LocInfoType.

2015-12-28 Thread Serge Pavlov via cfe-commits
Author: sepavloff Date: Mon Dec 28 11:19:12 2015 New Revision: 256503 URL: http://llvm.org/viewvc/llvm-project?rev=256503=rev Log: Avoid crash when dumping LocInfoType. LocInfoType is a helper type used internally inside Sema and Parser, it does not exist in valid AST. LocInfoType uses code

r256511 - Do not crash if class is defined in wrong scope.

2015-12-28 Thread Serge Pavlov via cfe-commits
Author: sepavloff Date: Mon Dec 28 13:40:14 2015 New Revision: 256511 URL: http://llvm.org/viewvc/llvm-project?rev=256511=rev Log: Do not crash if class is defined in wrong scope. This patch fixes PR16677. The latter represents the case when due to misprinted character class definition occurs in

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

2015-11-25 Thread Serge Pavlov via cfe-commits
sepavloff added a comment. If you are going to make unit tests, consider alternative approach also. In repository `test-suite` the directory `SingleSource/UnitTests` contains runtime tests obtained from single file. You could modify Makefile that runs these tests in such a way that each test

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

2015-11-23 Thread Serge Pavlov via cfe-commits
sepavloff added a comment. Unit test, of course, checks import facility but i would say this is overkill. You need to create tests for all nodes you implement in imported, this is huge amount of work. I would propose you to move tests from http://reviews.llvm.org/D14224 for nodes that are

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=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. In

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

[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

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=rev Log: Detect recursive default argument definition If definition of default function argument uses itself, clang crashed, because corresponding function parameter is not

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=60644#toc Repository: rL LLVM

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

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()

[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] 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

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

[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

[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

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 : >

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 >

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

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-01-29 Thread Serge Pavlov via cfe-commits
Can somebody have a look at this fix? Thank you! --Serge 2016-01-11 23:50 GMT+06:00 Serge Pavlov : > Any feedback? > > Thanks, > --Serge > > 2015-12-11 20:24 GMT+06:00 Serge Pavlov : > >> sepavloff created this revision. >> sepavloff added a subscriber:

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

2016-01-29 Thread Serge Pavlov via cfe-commits
11:51 AM, Serge Pavlov via cfe-commits wrote: > >> Can somebody have a look at this fix? >> Thank you! >> > > Testcase? > > >> --Serge >> >> 2016-01-11 23:50 GMT+06:00 Serge Pavlov <sepavl...@gmail.com >> <mailto:sepavl...@gmail.com>>:

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

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

2016-02-28 Thread Serge Pavlov via cfe-commits
2016-02-19 20:52 GMT+06:00 Aleksei Sidorin : > a.sidorin added a comment. > > Serge Pavlov: I'll enable tests from you patch ( > http://reviews.llvm.org/D14224) after all node types your patch supports > will be supported. If you're agree, of course. > > Yes, sure, that

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

2016-02-29 Thread Serge Pavlov via cfe-commits
Any feedback? Thanks, --Serge 2016-01-21 14:33 GMT+06:00 Serge Pavlov : > sepavloff created this revision. > sepavloff added a reviewer: rsmith. > sepavloff added subscribers: cfe-commits, silvas. > > Instantiation of static class members may be a source of user >

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

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

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

2016-01-21 Thread Serge Pavlov via cfe-commits
sepavloff created this revision. sepavloff added a reviewer: rsmith. sepavloff added subscribers: cfe-commits, silvas. Instantiation of static class members may be a source of user misunderstanding, especially in the case of using modules, PR24425 describes one of such examples. This patch

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

2016-01-26 Thread Serge Pavlov via cfe-commits
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 C1 { friend void func(T x); }; It may be not obvious for user, so compiler

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: >

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

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=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, which

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=rev Log: File missed from r261222 Added: cfe/trunk/unittests/Frontend/CodeGenActionTest.cpp Added: cfe/trunk/unittests/Frontend/CodeGenActionTest.cpp URL:

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=rev Log: Removed unused local variable Modified: cfe/trunk/lib/Sema/SemaTemplate.cpp Modified: cfe/trunk/lib/Sema/SemaTemplate.cpp URL:

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

2016-03-18 Thread Serge Pavlov via cfe-commits
sepavloff added a comment. Topic of friend function instantiation in C++ Standard discussion group

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

2016-03-14 Thread Serge Pavlov via cfe-commits
On Windows (VS2015 update1) two unit tests fail: ``` [ RUN ] ImportExpr.ImportGNUNullExpr input.cc:1:23: warning: expression result unused [-Wunused-value] void declToImport() { __null; } ^~ G:\arbeit\llvm2\llvm\tools\clang\unittests\AST\ASTImporterTest.cpp(149):

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

2016-03-14 Thread Serge Pavlov via cfe-commits
sepavloff added a subscriber: sepavloff. sepavloff added a comment. On Windows (VS2015 update1) two unit tests fail: [ RUN ] ImportExpr.ImportGNUNullExpr input.cc:1:23: warning: expression result unused [-Wunused-value] void declToImport() { __null; } ^~

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

2016-03-28 Thread Serge Pavlov via cfe-commits
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 approach. In this variant

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

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

2016-03-19 Thread Serge Pavlov via cfe-commits
Ping. Thanks, --Serge 2016-02-26 12:20 GMT+06:00 Serge Pavlov : > 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.

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

2016-03-19 Thread Serge Pavlov via cfe-commits
sepavloff added a comment. The last changes didn't help. AST generated in `ImportGNUNullExpr` is: TranslationUnitDecl 0xc46238 <> … | `-BuiltinType 0xc46290 'char' `-FunctionDecl 0xc468a0 col:6 declToImport 'void (void)' `-CompoundStmt 0xc46948

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

2016-03-19 Thread Serge Pavlov via cfe-commits
sepavloff updated this revision to Diff 51017. sepavloff added a comment. Do not emit warning on class methods. http://reviews.llvm.org/D16579 Files: include/clang/Basic/DiagnosticGroups.td include/clang/Basic/DiagnosticSemaKinds.td lib/Sema/SemaDecl.cpp test/CXX/drs/dr3xx.cpp

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

2016-03-20 Thread Serge Pavlov via cfe-commits
2016-03-18 0:35 GMT+06:00 Arthur O'Dwyer : > I'm not qualified to comment on the implementation, but I'm a bit > skeptical that this warning is appropriate in the first place. I've often > declared friend non-template functions, e.g. swap(). I've never intended to >

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

2016-03-21 Thread Serge Pavlov via cfe-commits
With the latest changes unit tests are successfully passed on Windows! You can go forward in completing the fix. Thanks, --Serge 2016-03-18 21:44 GMT+06:00 Aleksei Sidorin : > a.sidorin updated this revision to Diff 51027. > a.sidorin added a comment. > > Serge, thank you

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

2016-03-08 Thread Serge Pavlov via cfe-commits
sepavloff added a comment. I still cannot build project with your changes, now compiler cannot find symbol `hasSubStmt`. When committing the change please make sure that all prerequisites are committed and unit tests run successfully. I would recommend you to take tests from

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

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

2016-03-28 Thread Serge Pavlov via cfe-commits
sepavloff updated this revision to Diff 51817. sepavloff added a comment. Changed implementation This implementation uses another approach. Previous version of the patch put friend functions into redeclaration chains but modified search algorithm so that it skipped such functions. In this

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

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.

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 @@ >>

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. > -

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:

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

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

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

[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: [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

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

2016-04-19 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=54163#toc Repository: rL LLVM

r266719 - Warn if function or variable cannot be implicitly instantiated

2016-04-19 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=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 but

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

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:

[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); }; }

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

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

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

2016-07-18 Thread Serge Pavlov via cfe-commits
Any feedback? Thanks, --Serge 2016-06-20 1:52 GMT+06:00 Serge Pavlov : > sepavloff updated this revision to Diff 61220. > sepavloff added a comment. > > Updated patch > > Added handling of FunctionTemplateDecl to > shouldLinkDependentDeclWithPrevious. It is not > used now

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

2016-07-09 Thread Serge Pavlov via cfe-commits
sepavloff marked 6 inline comments as done. Comment at: include/clang/Sema/Sema.h:9469 @@ +9468,3 @@ + /// of proper templates, but they are needed for checks. + SmallVector FriendsOfTemplates; + Do we really need it? When compiler is compiling a module

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

2016-07-09 Thread Serge Pavlov via cfe-commits
sepavloff updated this revision to Diff 63386. sepavloff added a comment. Updated patch http://reviews.llvm.org/D16579 Files: include/clang/AST/TypeInstantiationMatcher.h include/clang/AST/TypeMatcher.h include/clang/Basic/DiagnosticGroups.td include/clang/Basic/DiagnosticSemaKinds.td

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

2016-07-09 Thread Serge Pavlov via cfe-commits
sepavloff updated this revision to Diff 63387. sepavloff added a comment. Repared file modes. http://reviews.llvm.org/D16579 Files: include/clang/AST/TypeInstantiationMatcher.h include/clang/AST/TypeMatcher.h include/clang/Basic/DiagnosticGroups.td

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

2016-07-09 Thread Serge Pavlov via cfe-commits
2016-07-01 15:26 GMT+06:00 Aleksei Sidorin : > a.sidorin updated this revision to Diff 62474. > a.sidorin added a comment. > > Fix some issues pointed by Serge Pavlov. > Serge: putting a check of FriendDecls to `IsStructurallyEquivalent()` > seems like a good idea for me,

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 { >

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

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=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

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

2016-08-17 Thread Serge Pavlov via cfe-commits
sepavloff updated this revision to Diff 68376. sepavloff added a comment. Rebased the patch 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/SemaCXX/friend2.cpp

r295541 - Process attributes 'ifunc' and 'alias' when checking for redefinition

2017-02-17 Thread Serge Pavlov via cfe-commits
Author: sepavloff Date: Sat Feb 18 00:04:15 2017 New Revision: 295541 URL: http://llvm.org/viewvc/llvm-project?rev=295541=rev Log: Process attributes 'ifunc' and 'alias' when checking for redefinition These attributes effectively turn a non-defining declaration into a definition, so the case

r296116 - Made test more target agnostic

2017-02-24 Thread Serge Pavlov via cfe-commits
Author: sepavloff Date: Fri Feb 24 07:15:08 2017 New Revision: 296116 URL: http://llvm.org/viewvc/llvm-project?rev=296116=rev Log: Made test more target agnostic Recommits r295975 (Added regression tests), reverted in r295975, because it did not work on non-X86 targets. Added:

  1   2   3   4   >