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

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

[PATCH] D23684: Resolve ambiguity in a declaration if global nested name specifier is used

2016-08-18 Thread Serge Pavlov via cfe-commits
sepavloff created this revision. sepavloff added reviewers: rsmith, doug.gregor. sepavloff added a subscriber: cfe-commits. If a declaration references a function from global namespace by its qualified name and if that function return type is a class or enum, there is possible ambiguity. The decla

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

2016-08-23 Thread Serge Pavlov via cfe-commits
sepavloff accepted this revision. sepavloff added a comment. LGTM. https://reviews.llvm.org/D14326 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2016-08-23 Thread Serge Pavlov via cfe-commits
Any feedback? Thanks, --Serge 2016-08-18 0:08 GMT+07:00 Serge Pavlov : > 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/PR2

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

2016-08-29 Thread Serge Pavlov via cfe-commits
sepavloff marked an inline comment as done. Comment at: lib/Sema/SemaDecl.cpp:8657-8658 @@ +8656,4 @@ + DeclContext *SemanticDC = D->getDeclContext(); + if (SemanticDC->isDependentContext()) +return false; + // Get here only for out-of-line declarations: lexical context is

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

2016-08-29 Thread Serge Pavlov via cfe-commits
sepavloff updated this revision to Diff 69595. sepavloff added a comment. Updated patch Added missing checks for forward declarations in `shouldLinkDependentDeclWithPrevious`. Added test case from an ancient bug report. https://reviews.llvm.org/D16989 Files: include/clang/Sema/Sema.h lib/

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

2016-08-29 Thread Serge Pavlov via cfe-commits
sepavloff updated this revision to Diff 69597. sepavloff added a comment. Added missed test case. https://reviews.llvm.org/D16989 Files: include/clang/Sema/Sema.h lib/Sema/SemaDecl.cpp test/SemaCXX/PR25848.cpp test/SemaCXX/friend2.cpp test/SemaCXX/function-redecl-2.cpp Index: test/Se

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

2016-09-01 Thread Serge Pavlov via cfe-commits
sepavloff updated this revision to Diff 70025. sepavloff added a comment. Fixed DR136 for template classes Previously clang created declarations of friend functions declared in template classes even if that class was not instantiated. It allowed to make check for default arguments required by D

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

2016-09-01 Thread Serge Pavlov via cfe-commits
sepavloff marked an inline comment as done. Comment at: lib/Sema/SemaDecl.cpp:8652 @@ +8651,3 @@ +/// +bool Sema::shouldLinkDependentDeclWithPrevious(Decl *D, Decl *PrevDecl) { + DeclContext *LexicalDC = D->getLexicalDeclContext(); rsmith wrote: > Most of the log

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

2016-09-01 Thread Serge Pavlov via cfe-commits
sepavloff updated this revision to Diff 70134. sepavloff marked an inline comment as done. sepavloff added a comment. Updated patch Rewrite the condition in shouldLinkDependentDeclWithPrevious in more compact form. https://reviews.llvm.org/D16989 Files: include/clang/Sema/Sema.h lib/Sema/

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

2016-09-06 Thread Serge Pavlov via cfe-commits
sepavloff added inline comments. Comment at: include/clang/Sema/Sema.h:6619 @@ -6618,1 +6618,3 @@ + ArrayRef varTemplateArguments() const; + I would propose to use something like 'getVarTemplateArguments' to make the name more similar to other methods. ==

Re: [PATCH] D23684: Resolve ambiguity in a declaration if global nested name specifier is used

2016-09-06 Thread Serge Pavlov via cfe-commits
sepavloff updated this revision to Diff 70503. sepavloff added a comment. Reworked patch https://reviews.llvm.org/D23684 Files: include/clang/Basic/DiagnosticParseKinds.td include/clang/Parse/Parser.h include/clang/Sema/Sema.h lib/Parse/ParseDecl.cpp lib/Parse/ParseExprCXX.cpp lib/P

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

2016-09-08 Thread Serge Pavlov via cfe-commits
Any feedback? Thanks, --Serge 2016-09-02 13:11 GMT+07:00 Serge Pavlov : > sepavloff updated this revision to Diff 70134. > sepavloff marked an inline comment as done. > sepavloff added a comment. > > Updated patch > > Rewrite the condition in shouldLinkDependentDeclWithPrevious in more > compact

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] 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 would be nice! I cannot c

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 > misunderstanding, > especially

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

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 http://reviews.llvm

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

2016-01-11 Thread Serge Pavlov via cfe-commits
Any feedback? Thanks, --Serge 2015-12-11 20:24 GMT+06:00 Serge Pavlov : > 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 go

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

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

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: cfe-commits. >> >> Llvm module object is s

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

2016-01-29 Thread Serge Pavlov via cfe-commits
test would be practical. The fact that an object is owned by two unique_ptr's may be enought to change implementation. However any thoughts how to test this behavior are wellcome. Thanks, --Serge 2016-01-30 0:54 GMT+06:00 Jonathan Roelofs : > > > On 1/29/16 11:51 AM, Serge Pavlov vi

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] 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; } ^~ G

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

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] 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. >> >> Declaration of friend function may dep

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 `-GNUNullExpr 0xc46938 'in

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 test/CX

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

2016-03-19 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 > declare a friend *template spec

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 for help! > GNUNullExpr

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 versi

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 information about potential defin

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

[PATCH] D24933: Enable configuration files in clang

2016-11-16 Thread Serge Pavlov via cfe-commits
sepavloff updated this revision to Diff 78167. sepavloff added a comment. Limit the patch by named configuration files only Follow advice of @mgorny and removed all features from the patch except named config files. These are files specified explicitly by option `--config` or encoded in executabl

[PATCH] D24933: Enable configuration files in clang

2016-11-20 Thread Serge Pavlov via cfe-commits
sepavloff updated this revision to Diff 78652. sepavloff added a comment. Herald added a subscriber: aemerson. Updated patch. - Restrict the search for config files specified by mangled clang name to binary directory only, - Allow the search for config files specified by `--config` in binary dir

[PATCH] D24933: Enable configuration files in clang

2016-11-20 Thread Serge Pavlov via cfe-commits
sepavloff marked 5 inline comments as done. sepavloff added a comment. > Rather than inventing a new mechanism, could we extend our existing `@file` > facility to support comments and nested inclusion of further `@file`s? Reusing `@file` is an attractive idea, but it cannot be implemented due to

[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

Re: [PATCH] D23765: Fix for clang PR 29087

2016-09-14 Thread Serge Pavlov via cfe-commits
sepavloff added a subscriber: sepavloff. sepavloff added a comment. You need to provide a test for the fix. https://reviews.llvm.org/D23765 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-co

[PATCH] D24649: Treat instantiations of variable templates as definitions

2016-09-16 Thread Serge Pavlov via cfe-commits
sepavloff created this revision. sepavloff added reviewers: rsmith, tra. sepavloff added a subscriber: cfe-commits. Current version of clang cannot build the program: ``` template int var; int main(int argc, char *argv[]) { return var<0>; } ``` as linker does not find `var<0>`, codegen treats i

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

2016-09-16 Thread Serge Pavlov via cfe-commits
Ping. Thanks, --Serge 2016-09-08 20:43 GMT+07:00 Serge Pavlov : > Any feedback? > > Thanks, > --Serge > > 2016-09-02 13:11 GMT+07:00 Serge Pavlov : > >> sepavloff updated this revision to Diff 70134. >> sepavloff marked an inline comment as done. >> sepavloff added a comment. >> >> Updated patch

[PATCH] D24917: Resolve response file names relative to including file

2016-09-26 Thread Serge Pavlov via cfe-commits
sepavloff created this revision. sepavloff added a reviewer: rnk. sepavloff added a subscriber: cfe-commits. If a response file included by construct @file itself includes a response file and that file is specified by relative file name, resolve the name relative to the including file. With this

[PATCH] D24933: Enable configuration files in clang

2016-09-26 Thread Serge Pavlov via cfe-commits
sepavloff created this revision. sepavloff added reviewers: rnk, ddunbar. sepavloff added a subscriber: cfe-commits. The implementation follows the discussion in mail list (http://lists.llvm.org/pipermail/cfe-dev/2016-September/050776.html). Main part of the config file support is implemented in l

[PATCH] D24933: Enable configuration files in clang

2016-10-03 Thread Serge Pavlov via cfe-commits
sepavloff updated this revision to Diff 73245. sepavloff added a comment. Updated path The patch is aligned with corresponding changes in llvm repository (https://reviews.llvm.org/D24926). Also support of configuration selection for executables line foo-clang is added. https://reviews.llvm.org

[PATCH] D24933: Enable configuration files in clang

2016-10-03 Thread Serge Pavlov via cfe-commits
sepavloff added inline comments. > mgorny wrote in driver.cpp:334 > 1. I'm not sure if others would agree with me but I think it would be better > to move those default paths straight to LLVM. If others tools are to adopt > those configuration files, it would only be reasonable to use the same

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

2016-10-03 Thread Serge Pavlov via cfe-commits
Ping. Thanks, --Serge 2016-09-16 23:17 GMT+07:00 Serge Pavlov : > Ping. > > Thanks, > --Serge > > 2016-09-08 20:43 GMT+07:00 Serge Pavlov : > >> Any feedback? >> >> Thanks, >> --Serge >> >> 2016-09-02 13:11 GMT+07:00 Serge Pavlov : >> >>> sepavloff updated this revision to Diff 70134. >>> sepavl

r283207 - Do not find friend function definitions inside non-instantiated class.

2016-10-04 Thread Serge Pavlov via cfe-commits
Author: sepavloff Date: Tue Oct 4 05:11:43 2016 New Revision: 283207 URL: http://llvm.org/viewvc/llvm-project?rev=283207&view=rev Log: Do not find friend function definitions inside non-instantiated class. Previously if a file-level function was defined inside befriending template class, it alwa

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

2016-10-04 Thread Serge Pavlov via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL283207: Do not find friend function definitions inside non-instantiated class. (authored by sepavloff). Changed prior to commit: https://reviews.llvm.org/D16989?vs=70134&id=73440#toc Repository: rL L

[PATCH] D24933: Enable configuration files in clang

2016-10-04 Thread Serge Pavlov via cfe-commits
sepavloff updated this revision to Diff 73482. sepavloff added a comment. Updated comments. https://reviews.llvm.org/D24933 Files: include/clang/Driver/Driver.h lib/Driver/Driver.cpp test/Driver/Inputs/config-1.cfg test/Driver/Inputs/config-2.cfg test/Driver/config-file.c test/Drive

[PATCH] D24933: Enable configuration files in clang

2016-10-04 Thread Serge Pavlov via cfe-commits
sepavloff added inline comments. > mgorny wrote in driver.cpp:314 > Please document what this function does, exactly. I see you've documented it > in call site but a doc here would be helpful as well. The function is documented now. > mgorny wrote in driver.cpp:376 > Are you sure about the nam

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

2016-10-05 Thread Serge Pavlov via cfe-commits
sepavloff added a comment. IIUC, the problem is observed because `Sema::getTemplateInstantiationArgs` does not handle the case of variable templates properly. Classes and functions are declaration contexts and implementation of the aforementioned function (and probably others) relies on this fa

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

2016-10-11 Thread Serge Pavlov via cfe-commits
sepavloff updated this revision to Diff 74218. sepavloff added a comment. Updated comments, NFC otherwise. https://reviews.llvm.org/D21508 Files: include/clang/AST/DeclTemplate.h lib/AST/DeclTemplate.cpp lib/Sema/SemaDecl.cpp test/SemaCXX/friend2.cpp Index: test/SemaCXX/friend2.cpp ===

[clang] a633da5 - [FPEnv] Partially implement #pragma STDC FENV_ROUND

2020-09-04 Thread Serge Pavlov via cfe-commits
Author: Serge Pavlov Date: 2020-09-04T16:47:10+07:00 New Revision: a633da5391b0e42c0185132e8b532ae9bc34489f URL: https://github.com/llvm/llvm-project/commit/a633da5391b0e42c0185132e8b532ae9bc34489f DIFF: https://github.com/llvm/llvm-project/commit/a633da5391b0e42c0185132e8b532ae9bc34489f.diff

[clang] 6c8041a - [AST][FPEnv] Keep FP options in trailing storage of CastExpr

2020-09-12 Thread Serge Pavlov via cfe-commits
Author: Serge Pavlov Date: 2020-09-12T14:30:44+07:00 New Revision: 6c8041aa0ffed827636935e59c489b1e390c8542 URL: https://github.com/llvm/llvm-project/commit/6c8041aa0ffed827636935e59c489b1e390c8542 DIFF: https://github.com/llvm/llvm-project/commit/6c8041aa0ffed827636935e59c489b1e390c8542.diff

[clang] 9c651c2 - Missing change from previous commit

2020-09-12 Thread Serge Pavlov via cfe-commits
Author: Serge Pavlov Date: 2020-09-12T15:11:09+07:00 New Revision: 9c651c231f3144f53e13cd0a1747589e1b2edccd URL: https://github.com/llvm/llvm-project/commit/9c651c231f3144f53e13cd0a1747589e1b2edccd DIFF: https://github.com/llvm/llvm-project/commit/9c651c231f3144f53e13cd0a1747589e1b2edccd.diff

[clang] de044f7 - Revert "[AST][FPEnv] Keep FP options in trailing storage of CastExpr"

2020-09-12 Thread Serge Pavlov via cfe-commits
Author: Serge Pavlov Date: 2020-09-12T17:06:42+07:00 New Revision: de044f756286edebf86044d5172016d87f49fda0 URL: https://github.com/llvm/llvm-project/commit/de044f756286edebf86044d5172016d87f49fda0 DIFF: https://github.com/llvm/llvm-project/commit/de044f756286edebf86044d5172016d87f49fda0.diff

[clang] f1cd659 - [AST][FPEnv] Keep FP options in trailing storage of CastExpr

2020-09-13 Thread Serge Pavlov via cfe-commits
Author: Serge Pavlov Date: 2020-09-14T12:15:21+07:00 New Revision: f1cd6593da3ad763eb3f7aaf7761d06fb303493a URL: https://github.com/llvm/llvm-project/commit/f1cd6593da3ad763eb3f7aaf7761d06fb303493a DIFF: https://github.com/llvm/llvm-project/commit/f1cd6593da3ad763eb3f7aaf7761d06fb303493a.diff

<    1   2   3   4   >