r290146 - Fix completely bogus types for some builtins:

2016-12-19 Thread Richard Smith via cfe-commits
Author: rsmith Date: Mon Dec 19 17:59:34 2016 New Revision: 290146 URL: http://llvm.org/viewvc/llvm-project?rev=290146&view=rev Log: Fix completely bogus types for some builtins: * In C++, never create a FunctionNoProtoType for a builtin (fixes C++1z crasher from r289754). * Fix type of __s

Re: r289754 - [c++1z] Permit constant evaluation of a call through a function pointer whose

2016-12-19 Thread Richard Smith via cfe-commits
tstrap/bin/clang-3.8+0x28fd392) > #24 0x0000028f5acb clang::ParseAST(clang::Sema&, bool, bool) > (/usr/local/google/home/aizatsky/out/llvm/bootstrap/ > bin/clang-3.8+0x28f5acb) > #25 0x0250587e clang::CodeGenAction::ExecuteAction() > (/usr/local/google/home/aizatsky

r290166 - Add test for DR692.

2016-12-19 Thread Richard Smith via cfe-commits
Author: rsmith Date: Tue Dec 20 01:24:53 2016 New Revision: 290166 URL: http://llvm.org/viewvc/llvm-project?rev=290166&view=rev Log: Add test for DR692. Modified: cfe/trunk/test/CXX/drs/dr6xx.cpp Modified: cfe/trunk/test/CXX/drs/dr6xx.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/t

r290203 - [c++1z] P0195R2: Support pack-expansion of using-declarations.

2016-12-20 Thread Richard Smith via cfe-commits
Author: rsmith Date: Tue Dec 20 15:35:28 2016 New Revision: 290203 URL: http://llvm.org/viewvc/llvm-project?rev=290203&view=rev Log: [c++1z] P0195R2: Support pack-expansion of using-declarations. This change introduces UsingPackDecl as a marker for the set of UsingDecls produced by pack expansion

Re: r290080 - [c++1z] P0195R2: Support pack-expansion of using-declarations.

2016-12-20 Thread Richard Smith via cfe-commits
On 19 December 2016 at 04:26, Renato Golin wrote: > On 19 December 2016 at 11:28, Daniel Jasper via cfe-commits > wrote: > > I have reverted this in r290092 as it was leading to Clang crashes on the > > bots and elsewhere, e.g.: > > http://lab.llvm.org:8011/builders/clang-cmake-aarch64-quick/bui

r290225 - Factor out checking of template arguments after deduction into a separate

2016-12-20 Thread Richard Smith via cfe-commits
Author: rsmith Date: Tue Dec 20 19:10:31 2016 New Revision: 290225 URL: http://llvm.org/viewvc/llvm-project?rev=290225&view=rev Log: Factor out checking of template arguments after deduction into a separate function. (This change would also allow us to handle default template arguments in partial

r290227 - [c++1z] When initializing a const-qualified class type, don't forget to add on

2016-12-20 Thread Richard Smith via cfe-commits
Author: rsmith Date: Tue Dec 20 19:31:56 2016 New Revision: 290227 URL: http://llvm.org/viewvc/llvm-project?rev=290227&view=rev Log: [c++1z] When initializing a const-qualified class type, don't forget to add on the requested cv-qualifiers after construction. This usually doesn't matter, but it do

r290229 - Fix defaulted-functions-in-C++98 extension to give the functions the same

2016-12-20 Thread Richard Smith via cfe-commits
Author: rsmith Date: Tue Dec 20 19:57:02 2016 New Revision: 290229 URL: http://llvm.org/viewvc/llvm-project?rev=290229&view=rev Log: Fix defaulted-functions-in-C++98 extension to give the functions the same effect they would have in C++11. In particular, they do not prevent value-initialization fr

Re: r290146 - Fix completely bogus types for some builtins:

2016-12-20 Thread Richard Smith via cfe-commits
On 19 December 2016 at 17:00, Friedman, Eli via cfe-commits < cfe-commits@lists.llvm.org> wrote: > On 12/19/2016 3:59 PM, Richard Smith via cfe-commits wrote: > >> Author: rsmith >> Date: Mon Dec 19 17:59:34 2016 >> New Revision: 290146 >> >> URL: htt

Re: r290146 - Fix completely bogus types for some builtins:

2016-12-20 Thread Richard Smith via cfe-commits
On 20 December 2016 at 18:14, Richard Smith wrote: > On 19 December 2016 at 17:00, Friedman, Eli via cfe-commits < > cfe-commits@lists.llvm.org> wrote: > >> On 12/19/2016 3:59 PM, Richard Smith via cfe-commits wrote: >> >>> Author: rsmith >>> Da

r290276 - Perform type-checking for a converted constant expression in a template

2016-12-21 Thread Richard Smith via cfe-commits
Author: rsmith Date: Wed Dec 21 15:42:57 2016 New Revision: 290276 URL: http://llvm.org/viewvc/llvm-project?rev=290276&view=rev Log: Perform type-checking for a converted constant expression in a template argument even if the expression is value-dependent (we need to suppress the final portion of

r290310 - Only substitute into type of non-type template parameter once, rather than

2016-12-21 Thread Richard Smith via cfe-commits
Author: rsmith Date: Wed Dec 21 21:52:37 2016 New Revision: 290310 URL: http://llvm.org/viewvc/llvm-project?rev=290310&view=rev Log: Only substitute into type of non-type template parameter once, rather than twice, in finalization of template argumetn deduction. Modified: cfe/trunk/lib/Sema/S

r290329 - Speculative revert of r290310 to see if that's the change that's making some of

2016-12-21 Thread Richard Smith via cfe-commits
Author: rsmith Date: Thu Dec 22 01:24:39 2016 New Revision: 290329 URL: http://llvm.org/viewvc/llvm-project?rev=290329&view=rev Log: Speculative revert of r290310 to see if that's the change that's making some of the bots unhappy. Modified: cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp Modifi

r290399 - When merging two deduced non-type template arguments for the same parameter,

2016-12-22 Thread Richard Smith via cfe-commits
Author: rsmith Date: Thu Dec 22 19:30:39 2016 New Revision: 290399 URL: http://llvm.org/viewvc/llvm-project?rev=290399&view=rev Log: When merging two deduced non-type template arguments for the same parameter, fail the merge if the arguments have different types (except if one of them was deduced

r290403 - Only substitute into type of non-type template parameter once, rather than

2016-12-22 Thread Richard Smith via cfe-commits
Author: rsmith Date: Thu Dec 22 20:00:24 2016 New Revision: 290403 URL: http://llvm.org/viewvc/llvm-project?rev=290403&view=rev Log: Only substitute into type of non-type template parameter once, rather than twice, in finalization of template argument deduction. This is a re-commit of r290310 (re

r290405 - Move generation of injected template arguments for a template parameter list

2016-12-22 Thread Richard Smith via cfe-commits
Author: rsmith Date: Thu Dec 22 20:10:11 2016 New Revision: 290405 URL: http://llvm.org/viewvc/llvm-project?rev=290405&view=rev Log: Move generation of injected template arguments for a template parameter list out of an internal function and into ASTContext; this is needed in template argument ded

Re: r290399 - When merging two deduced non-type template arguments for the same parameter,

2016-12-23 Thread Richard Smith via cfe-commits
On 22 Dec 2016 9:32 pm, "Chandler Carruth via cfe-commits" < cfe-commits@lists.llvm.org> wrote: On Thu, Dec 22, 2016 at 5:41 PM Richard Smith via cfe-commits < cfe-commits@lists.llvm.org> wrote: > > ==

Re: r290417 - Add an assert to catch improperly constructed %diff sequences in

2016-12-23 Thread Richard Smith via cfe-commits
On 22 December 2016 at 21:19, Chandler Carruth via cfe-commits < cfe-commits@lists.llvm.org> wrote: > Author: chandlerc > Date: Thu Dec 22 23:19:47 2016 > New Revision: 290417 > > URL: http://llvm.org/viewvc/llvm-project?rev=290417&view=rev > Log: > Add an assert to catch improperly constructed %d

r290461 - ArrayRefize lists of TemplateArguments in template argument deduction.

2016-12-23 Thread Richard Smith via cfe-commits
Author: rsmith Date: Fri Dec 23 17:46:56 2016 New Revision: 290461 URL: http://llvm.org/viewvc/llvm-project?rev=290461&view=rev Log: ArrayRefize lists of TemplateArguments in template argument deduction. Modified: cfe/trunk/include/clang/AST/TemplateBase.h cfe/trunk/lib/Sema/SemaTemplateD

r290483 - When producing a name of a partial specialization in a diagnostic, use the

2016-12-23 Thread Richard Smith via cfe-commits
Author: rsmith Date: Fri Dec 23 22:09:05 2016 New Revision: 290483 URL: http://llvm.org/viewvc/llvm-project?rev=290483&view=rev Log: When producing a name of a partial specialization in a diagnostic, use the template arguments as written rather than the canonical template arguments, so we print mo

r290484 - Fix crash if substitution fails during deduction of variable template partial specialization arguments.

2016-12-23 Thread Richard Smith via cfe-commits
Author: rsmith Date: Fri Dec 23 22:20:31 2016 New Revision: 290484 URL: http://llvm.org/viewvc/llvm-project?rev=290484&view=rev Log: Fix crash if substitution fails during deduction of variable template partial specialization arguments. Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaK

r290485 - Remove accidentally-left-behind commented out code.

2016-12-23 Thread Richard Smith via cfe-commits
Author: rsmith Date: Fri Dec 23 22:22:52 2016 New Revision: 290485 URL: http://llvm.org/viewvc/llvm-project?rev=290485&view=rev Log: Remove accidentally-left-behind commented out code. Modified: cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp Modified: cfe/trunk/lib/Sema/SemaTemplateInstantia

r290497 - Factor out duplication between partial ordering for class template partial

2016-12-24 Thread Richard Smith via cfe-commits
Author: rsmith Date: Sat Dec 24 10:40:51 2016 New Revision: 290497 URL: http://llvm.org/viewvc/llvm-project?rev=290497&view=rev Log: Factor out duplication between partial ordering for class template partial specializations and variable template partial specializations. Modified: cfe/trunk/li

r290511 - Fix some subtle wrong partial ordering bugs particularly with C++1z auto-typed

2016-12-25 Thread Richard Smith via cfe-commits
Author: rsmith Date: Sun Dec 25 02:05:23 2016 New Revision: 290511 URL: http://llvm.org/viewvc/llvm-project?rev=290511&view=rev Log: Fix some subtle wrong partial ordering bugs particularly with C++1z auto-typed non-type template parameters. During partial ordering, when checking the substituted

r290522 - Fix assertion failure when deducing an auto-typed argument against a different-width int.

2016-12-25 Thread Richard Smith via cfe-commits
Author: rsmith Date: Sun Dec 25 14:21:12 2016 New Revision: 290522 URL: http://llvm.org/viewvc/llvm-project?rev=290522&view=rev Log: Fix assertion failure when deducing an auto-typed argument against a different-width int. Modified: cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp cfe/trunk/

r290552 - Update comment to match dr1770.

2016-12-26 Thread Richard Smith via cfe-commits
Author: rsmith Date: Mon Dec 26 16:28:29 2016 New Revision: 290552 URL: http://llvm.org/viewvc/llvm-project?rev=290552&view=rev Log: Update comment to match dr1770. Modified: cfe/trunk/lib/Sema/SemaTemplate.cpp Modified: cfe/trunk/lib/Sema/SemaTemplate.cpp URL: http://llvm.org/viewvc/llvm-p

r290567 - Check and build conversion sequences for non-type template arguments in

2016-12-26 Thread Richard Smith via cfe-commits
Author: rsmith Date: Mon Dec 26 20:02:09 2016 New Revision: 290567 URL: http://llvm.org/viewvc/llvm-project?rev=290567&view=rev Log: Check and build conversion sequences for non-type template arguments in dependent contexts when processing the template in C++11 and C++14, just like we do in C++98

r290576 - Factor out repeated code for deducing a non-type template parameter as a given

2016-12-26 Thread Richard Smith via cfe-commits
Author: rsmith Date: Mon Dec 26 21:59:58 2016 New Revision: 290576 URL: http://llvm.org/viewvc/llvm-project?rev=290576&view=rev Log: Factor out repeated code for deducing a non-type template parameter as a given argument value. No functionality change intended. Modified: cfe/trunk/lib/Sema/Se

Re: r290577 - Add a test for `const` folding introduced by r290297. NFC.

2016-12-26 Thread Richard Smith via cfe-commits
On 26 December 2016 at 20:01, George Burgess IV via cfe-commits < cfe-commits@lists.llvm.org> wrote: > Author: gbiv > Date: Mon Dec 26 22:01:22 2016 > New Revision: 290577 > > URL: http://llvm.org/viewvc/llvm-project?rev=290577&view=rev > Log: > Add a test for `const` folding introduced by r290297

r290586 - Work around a standard defect: template argument deduction for non-type

2016-12-26 Thread Richard Smith via cfe-commits
Author: rsmith Date: Tue Dec 27 00:14:37 2016 New Revision: 290586 URL: http://llvm.org/viewvc/llvm-project?rev=290586&view=rev Log: Work around a standard defect: template argument deduction for non-type template parameters of reference type basically doesn't work, because we're always deducing f

r290587 - Add reference/non-reference mismatch test.

2016-12-26 Thread Richard Smith via cfe-commits
Author: rsmith Date: Tue Dec 27 00:18:22 2016 New Revision: 290587 URL: http://llvm.org/viewvc/llvm-project?rev=290587&view=rev Log: Add reference/non-reference mismatch test. Modified: cfe/trunk/test/SemaTemplate/temp_arg_nontype.cpp Modified: cfe/trunk/test/SemaTemplate/temp_arg_nontype.cp

r290593 - DR1495: A partial specialization is ill-formed if it is not (strictly) more

2016-12-27 Thread Richard Smith via cfe-commits
Author: rsmith Date: Tue Dec 27 01:56:27 2016 New Revision: 290593 URL: http://llvm.org/viewvc/llvm-project?rev=290593&view=rev Log: DR1495: A partial specialization is ill-formed if it is not (strictly) more specialized than the primary template. (Put another way, if we imagine there were a parti

Re: r290577 - Add a test for `const` folding introduced by r290297. NFC.

2016-12-27 Thread Richard Smith via cfe-commits
Great, thanks! On 26 December 2016 at 21:44, George Burgess IV wrote: > r290584 :) > > On Mon, Dec 26, 2016 at 8:30 PM, George Burgess IV < > george.burgess...@gmail.com> wrote: > >> SG; working on a follow-up now. Thanks! >> >> On Mon, Dec 26, 2

Re: r290593 - DR1495: A partial specialization is ill-formed if it is not (strictly) more

2016-12-27 Thread Richard Smith via cfe-commits
arily put this DR fix behind a flag or make it a warning? Sure, I'll downgrade it to an ExtWarn. We should also let the Eigen folks know. On Tue, Dec 27, 2016 at 12:07 AM Richard Smith via cfe-commits < cfe-commits@lists.llvm.org> wrote: > Author: rsmith > Date: Tue Dec 27 01:

Re: r290593 - DR1495: A partial specialization is ill-formed if it is not (strictly) more

2016-12-27 Thread Richard Smith via cfe-commits
&fileviewer=file-view-default#TensorStorage.h-38 One way to fix this is: -template -class TensorStorage +template +class TensorStorage That is, define the primary template instead of defining a partial specialization that doesn't actually specialize anything. On 27 December 2016 at 10:41, Rich

r290625 - Add warning flag for "partial specialization is not more specialized than primary template" error (since Eigen hits it), and while I'm here also add a warning flag for "partial specializatio

2016-12-27 Thread Richard Smith via cfe-commits
Author: rsmith Date: Tue Dec 27 14:03:09 2016 New Revision: 290625 URL: http://llvm.org/viewvc/llvm-project?rev=290625&view=rev Log: Add warning flag for "partial specialization is not more specialized than primary template" error (since Eigen hits it), and while I'm here also add a warning flag

Re: r290593 - DR1495: A partial specialization is ill-formed if it is not (strictly) more

2016-12-27 Thread Richard Smith via cfe-commits
On 27 December 2016 at 10:41, Richard Smith wrote: > On 27 Dec 2016 1:42 am, "Chandler Carruth via cfe-commits" < > cfe-commits@lists.llvm.org> wrote: > > I suspect that this commit is responsible for a regression parsing widely > used open source packages like E

r290647 - DR1315: a non-type template argument in a partial specialization is permitted

2016-12-27 Thread Richard Smith via cfe-commits
Author: rsmith Date: Tue Dec 27 20:37:25 2016 New Revision: 290647 URL: http://llvm.org/viewvc/llvm-project?rev=290647&view=rev Log: DR1315: a non-type template argument in a partial specialization is permitted to make reference to template parameters. This is only a partial implementation; we ret

r290660 - Mark 'auto' as dependent when instantiating the type of a non-type template

2016-12-27 Thread Richard Smith via cfe-commits
Author: rsmith Date: Wed Dec 28 00:27:18 2016 New Revision: 290660 URL: http://llvm.org/viewvc/llvm-project?rev=290660&view=rev Log: Mark 'auto' as dependent when instantiating the type of a non-type template parameter. Fixes failed deduction for 'auto' non-type template parameters nested within t

r290743 - Remove bogus assertion and add testcase that triggers it.

2016-12-29 Thread Richard Smith via cfe-commits
Author: rsmith Date: Thu Dec 29 22:32:02 2016 New Revision: 290743 URL: http://llvm.org/viewvc/llvm-project?rev=290743&view=rev Log: Remove bogus assertion and add testcase that triggers it. Modified: cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp cfe/trunk/test/SemaTemplate/temp_arg_nontyp

Re: r290773 - Wdocumentation fix

2016-12-30 Thread Richard Smith via cfe-commits
On 30 Dec 2016 3:06 pm, "Simon Pilgrim via cfe-commits" < cfe-commits@lists.llvm.org> wrote: Author: rksimon Date: Fri Dec 30 16:55:33 2016 New Revision: 290773 URL: http://llvm.org/viewvc/llvm-project?rev=290773&view=rev Log: Wdocumentation fix Thanks, but please be careful you don't introduce

r290780 - Remove redundant assertion.

2016-12-30 Thread Richard Smith via cfe-commits
Author: rsmith Date: Fri Dec 30 21:33:42 2016 New Revision: 290780 URL: http://llvm.org/viewvc/llvm-project?rev=290780&view=rev Log: Remove redundant assertion. Modified: cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp Modified: cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp URL: http://llvm.org

r290792 - [c++17] Implement P0522R0 as written. This allows a template template argument

2016-12-31 Thread Richard Smith via cfe-commits
Author: rsmith Date: Sat Dec 31 15:41:23 2016 New Revision: 290792 URL: http://llvm.org/viewvc/llvm-project?rev=290792&view=rev Log: [c++17] Implement P0522R0 as written. This allows a template template argument to be specified for a template template parameter whenever the parameter is at least a

r290807 - Address post-commit review comments.

2017-01-01 Thread Richard Smith via cfe-commits
Author: rsmith Date: Sun Jan 1 20:38:22 2017 New Revision: 290807 URL: http://llvm.org/viewvc/llvm-project?rev=290807&view=rev Log: Address post-commit review comments. Modified: cfe/trunk/include/clang/Basic/LangOptions.def cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp Modified: cfe/tru

Re: r290792 - [c++17] Implement P0522R0 as written. This allows a template template argument

2017-01-01 Thread Richard Smith via cfe-commits
Thanks both of you, r290807. On 1 January 2017 at 07:28, Erik Pilkington wrote: > > > On Dec 31, 2016, at 4:41 PM, Richard Smith via cfe-commits < > cfe-commits@lists.llvm.org> wrote: > > > > Author: rsmith > > Date: Sat Dec 31 15:41:23 2016 > > New Rev

r290808 - DR1391: Check for implicit conversion sequences for non-dependent function

2017-01-01 Thread Richard Smith via cfe-commits
Author: rsmith Date: Sun Jan 1 20:42:17 2017 New Revision: 290808 URL: http://llvm.org/viewvc/llvm-project?rev=290808&view=rev Log: DR1391: Check for implicit conversion sequences for non-dependent function template parameters between deduction and substitution. The idea is to accept as many case

Re: r290808 - DR1391: Check for implicit conversion sequences for non-dependent function

2017-01-02 Thread Richard Smith via cfe-commits
On 2 Jan 2017 3:27 am, "Renato Golin" wrote: On 2 January 2017 at 02:42, Richard Smith via cfe-commits wrote: > Author: rsmith > Date: Sun Jan 1 20:42:17 2017 > New Revision: 290808 > > URL: http://llvm.org/viewvc/llvm-project?rev=290808&view=rev > Log: > DR

r290843 - Add testcase for the regression introduced in r290808.

2017-01-02 Thread Richard Smith via cfe-commits
Author: rsmith Date: Mon Jan 2 17:00:32 2017 New Revision: 290843 URL: http://llvm.org/viewvc/llvm-project?rev=290843&view=rev Log: Add testcase for the regression introduced in r290808. Modified: cfe/trunk/test/SemaTemplate/deduction.cpp Modified: cfe/trunk/test/SemaTemplate/deduction.cpp

r290923 - Fix template argument deduction when only some of a parameter pack is a non-deduced context.

2017-01-03 Thread Richard Smith via cfe-commits
Author: rsmith Date: Tue Jan 3 19:48:55 2017 New Revision: 290923 URL: http://llvm.org/viewvc/llvm-project?rev=290923&view=rev Log: Fix template argument deduction when only some of a parameter pack is a non-deduced context. When a parameter pack has multiple corresponding arguments, and some s

r290926 - Remove accidentally-added lines in r290923 test, and add another testcase.

2017-01-03 Thread Richard Smith via cfe-commits
Author: rsmith Date: Tue Jan 3 20:03:39 2017 New Revision: 290926 URL: http://llvm.org/viewvc/llvm-project?rev=290926&view=rev Log: Remove accidentally-added lines in r290923 test, and add another testcase. Modified: cfe/trunk/test/SemaTemplate/deduction.cpp Modified: cfe/trunk/test/SemaTem

r290933 - Fix deduction of pack elements after a braced-init-list.

2017-01-03 Thread Richard Smith via cfe-commits
Author: rsmith Date: Tue Jan 3 20:59:16 2017 New Revision: 290933 URL: http://llvm.org/viewvc/llvm-project?rev=290933&view=rev Log: Fix deduction of pack elements after a braced-init-list. Previously, if the arguments for a parameter pack contained a braced-init-list, we would abort deduction (k

r290996 - Factor out duplicated code and simplify.

2017-01-04 Thread Richard Smith via cfe-commits
Author: rsmith Date: Wed Jan 4 13:47:19 2017 New Revision: 290996 URL: http://llvm.org/viewvc/llvm-project?rev=290996&view=rev Log: Factor out duplicated code and simplify. No functionality change intended. Modified: cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp cfe/trunk/test/SemaCXX/cx

r290997 - Revert accidentally-committed file.

2017-01-04 Thread Richard Smith via cfe-commits
Author: rsmith Date: Wed Jan 4 13:48:07 2017 New Revision: 290997 URL: http://llvm.org/viewvc/llvm-project?rev=290997&view=rev Log: Revert accidentally-committed file. Modified: cfe/trunk/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp Modified: cfe/trunk/test/SemaCXX/cxx0x-initialize

r291014 - Fix failure to treat overloaded function in braced-init-list as a non-deduced context.

2017-01-04 Thread Richard Smith via cfe-commits
Author: rsmith Date: Wed Jan 4 16:03:59 2017 New Revision: 291014 URL: http://llvm.org/viewvc/llvm-project?rev=291014&view=rev Log: Fix failure to treat overloaded function in braced-init-list as a non-deduced context. Previously, if an overloaded function in a braced-init-list was encountered

r291030 - Bail out if we try to build a DeclRefExpr naming an invalid declaration.

2017-01-04 Thread Richard Smith via cfe-commits
Author: rsmith Date: Wed Jan 4 17:14:16 2017 New Revision: 291030 URL: http://llvm.org/viewvc/llvm-project?rev=291030&view=rev Log: Bail out if we try to build a DeclRefExpr naming an invalid declaration. Most code paths would already bail out in this case, but certain paths, particularly overlo

r291034 - Only instantiate members of nested classes in local classes once, rather than once per enclosing class.

2017-01-04 Thread Richard Smith via cfe-commits
Author: rsmith Date: Wed Jan 4 17:45:01 2017 New Revision: 291034 URL: http://llvm.org/viewvc/llvm-project?rev=291034&view=rev Log: Only instantiate members of nested classes in local classes once, rather than once per enclosing class. Modified: cfe/trunk/lib/Sema/SemaTemplateInstantiateDec

r291064 - Fix assertion failure on deduction failure due to too short template argument list.

2017-01-04 Thread Richard Smith via cfe-commits
Author: rsmith Date: Wed Jan 4 20:31:32 2017 New Revision: 291064 URL: http://llvm.org/viewvc/llvm-project?rev=291064&view=rev Log: Fix assertion failure on deduction failure due to too short template argument list. We were previously incorrectly using TDK_TooFewArguments to report a template a

[libcxx] r291065 - PR31540: install libc++abi headers into include/c++/v1 in build area.

2017-01-04 Thread Richard Smith via cfe-commits
Author: rsmith Date: Wed Jan 4 20:55:10 2017 New Revision: 291065 URL: http://llvm.org/viewvc/llvm-project?rev=291065&view=rev Log: PR31540: install libc++abi headers into include/c++/v1 in build area. This allows an in-build-area clang binary to find . Modified: libcxx/trunk/cmake/Modules/

r291074 - Factor out more common logic in template argument deduction from function call arguments.

2017-01-04 Thread Richard Smith via cfe-commits
Author: rsmith Date: Wed Jan 4 22:08:31 2017 New Revision: 291074 URL: http://llvm.org/viewvc/llvm-project?rev=291074&view=rev Log: Factor out more common logic in template argument deduction from function call arguments. No functionality change intended. Modified: cfe/trunk/lib/Sema/SemaT

r291075 - Per [temp.deduct.call], do not deduce an array bound of 0 from an empty initializer list.

2017-01-04 Thread Richard Smith via cfe-commits
Author: rsmith Date: Wed Jan 4 22:16:30 2017 New Revision: 291075 URL: http://llvm.org/viewvc/llvm-project?rev=291075&view=rev Log: Per [temp.deduct.call], do not deduce an array bound of 0 from an empty initializer list. Modified: cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp cfe/trunk/

r291170 - If an explicitly-specified pack might have been extended by template argument

2017-01-05 Thread Richard Smith via cfe-commits
Author: rsmith Date: Thu Jan 5 14:27:28 2017 New Revision: 291170 URL: http://llvm.org/viewvc/llvm-project?rev=291170&view=rev Log: If an explicitly-specified pack might have been extended by template argument deduction, don't forget to check the argument is valid. Modified: cfe/trunk/lib/Se

r291190 - Add missing "original call argument has same type as deduced parameter type"

2017-01-05 Thread Richard Smith via cfe-commits
Author: rsmith Date: Thu Jan 5 17:02:44 2017 New Revision: 291190 URL: http://llvm.org/viewvc/llvm-project?rev=291190&view=rev Log: Add missing "original call argument has same type as deduced parameter type" check for deductions from elements of a braced-init-list. Modified: cfe/trunk/inclu

r291191 - Fix bug where types other than 'cv auto', 'cv auto &', and 'cv auto &&' could

2017-01-05 Thread Richard Smith via cfe-commits
Author: rsmith Date: Thu Jan 5 17:12:16 2017 New Revision: 291191 URL: http://llvm.org/viewvc/llvm-project?rev=291191&view=rev Log: Fix bug where types other than 'cv auto', 'cv auto &', and 'cv auto &&' could incorrectly be deduced from an initializer list in pathological cases. Modified: c

r291295 - Revisit PR10177: don't instantiate a variable if it's only referenced in a

2017-01-06 Thread Richard Smith via cfe-commits
Author: rsmith Date: Fri Jan 6 16:52:53 2017 New Revision: 291295 URL: http://llvm.org/viewvc/llvm-project?rev=291295&view=rev Log: Revisit PR10177: don't instantiate a variable if it's only referenced in a dependent context and can't be used in a constant expression. Per C++ [temp.inst]p2, "the

r291318 - PR23135: Don't instantiate constexpr functions referenced in unevaluated operands where possible.

2017-01-06 Thread Richard Smith via cfe-commits
Author: rsmith Date: Fri Jan 6 18:48:55 2017 New Revision: 291318 URL: http://llvm.org/viewvc/llvm-project?rev=291318&view=rev Log: PR23135: Don't instantiate constexpr functions referenced in unevaluated operands where possible. This implements something like the current direction of DR1581: w

r291319 - PR20090: Add (passing) test from this bug; it's been fixed for a while.

2017-01-06 Thread Richard Smith via cfe-commits
Author: rsmith Date: Fri Jan 6 18:52:10 2017 New Revision: 291319 URL: http://llvm.org/viewvc/llvm-project?rev=291319&view=rev Log: PR20090: Add (passing) test from this bug; it's been fixed for a while. Modified: cfe/trunk/test/SemaTemplate/constexpr-instantiate.cpp Modified: cfe/trunk/tes

r291358 - Consistently use a ConstantEvaluated context for expressions in attributes,

2017-01-07 Thread Richard Smith via cfe-commits
Author: rsmith Date: Sat Jan 7 13:42:26 2017 New Revision: 291358 URL: http://llvm.org/viewvc/llvm-project?rev=291358&view=rev Log: Consistently use a ConstantEvaluated context for expressions in attributes, except for those with the "attributes are unevaluated contexts" flag. Modified: cfe/

r291360 - Fix buildbots.

2017-01-07 Thread Richard Smith via cfe-commits
Author: rsmith Date: Sat Jan 7 13:58:39 2017 New Revision: 291360 URL: http://llvm.org/viewvc/llvm-project?rev=291360&view=rev Log: Fix buildbots. Modified: cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp Modified: cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp URL: http://llvm.org/

r291382 - PR18402: work around bug in libstdc++4.8's detection of whether ::gets exists.

2017-01-07 Thread Richard Smith via cfe-commits
Author: rsmith Date: Sat Jan 7 22:01:15 2017 New Revision: 291382 URL: http://llvm.org/viewvc/llvm-project?rev=291382&view=rev Log: PR18402: work around bug in libstdc++4.8's detection of whether ::gets exists. This should allow clang to successfully compile libstdc++4.8's headers in C++14 mode.

r291403 - PR30305: Implement proposed DR resolution to prevent slicing via inherited constructor.

2017-01-08 Thread Richard Smith via cfe-commits
Author: rsmith Date: Sun Jan 8 15:45:44 2017 New Revision: 291403 URL: http://llvm.org/viewvc/llvm-project?rev=291403&view=rev Log: PR30305: Implement proposed DR resolution to prevent slicing via inherited constructor. The rule we use is that a construction of a class type T from an argument o

r291407 - PR31514: Add recursive self-instantiation check during template argument

2017-01-08 Thread Richard Smith via cfe-commits
Author: rsmith Date: Sun Jan 8 16:45:21 2017 New Revision: 291407 URL: http://llvm.org/viewvc/llvm-project?rev=291407&view=rev Log: PR31514: Add recursive self-instantiation check during template argument deduction in partial ordering. This prevents us from crashing due to attempting to instanti

r291410 - Implement C++ DR1391 (wg21.link/cwg1391)

2017-01-08 Thread Richard Smith via cfe-commits
Author: rsmith Date: Sun Jan 8 18:43:47 2017 New Revision: 291410 URL: http://llvm.org/viewvc/llvm-project?rev=291410&view=rev Log: Implement C++ DR1391 (wg21.link/cwg1391) Check for implicit conversion sequences for non-dependent function template parameters between deduction and substitution.

r291411 - Fix test for targets whose preferred spelling for an 8-byte int is 'long long', not 'long'.

2017-01-08 Thread Richard Smith via cfe-commits
Author: rsmith Date: Sun Jan 8 19:10:14 2017 New Revision: 291411 URL: http://llvm.org/viewvc/llvm-project?rev=291411&view=rev Log: Fix test for targets whose preferred spelling for an 8-byte int is 'long long', not 'long'. Modified: cfe/trunk/test/SemaCXX/attr-mode-tmpl.cpp Modified: cfe/

r291412 - Revert r291410 and r291411.

2017-01-08 Thread Richard Smith via cfe-commits
Author: rsmith Date: Sun Jan 8 19:18:18 2017 New Revision: 291412 URL: http://llvm.org/viewvc/llvm-project?rev=291412&view=rev Log: Revert r291410 and r291411. The test-suite bots are still failing even after r291410's fix. Modified: cfe/trunk/include/clang/Sema/Overload.h cfe/trunk/inc

Re: r291416 - [cxx1z-constexpr-lambda] Implement constant evaluation of non-capturing lambda expressions.

2017-01-08 Thread Richard Smith via cfe-commits
On 8 January 2017 at 19:02, Faisal Vali via cfe-commits < cfe-commits@lists.llvm.org> wrote: > Author: faisalv > Date: Sun Jan 8 21:02:53 2017 > New Revision: 291416 > > URL: http://llvm.org/viewvc/llvm-project?rev=291416&view=rev > Log: > [cxx1z-constexpr-lambda] Implement constant evaluation of

r291425 - Implement DR1388 (wg21.link/cwg1388).

2017-01-08 Thread Richard Smith via cfe-commits
Author: rsmith Date: Mon Jan 9 01:14:40 2017 New Revision: 291425 URL: http://llvm.org/viewvc/llvm-project?rev=291425&view=rev Log: Implement DR1388 (wg21.link/cwg1388). This issue clarifies how deduction proceeds past a non-trailing function parameter pack. Essentially, the pack itself is skipp

r291427 - Implement C++ DR1391 (wg21.link/cwg1391)

2017-01-09 Thread Richard Smith via cfe-commits
Author: rsmith Date: Mon Jan 9 02:01:21 2017 New Revision: 291427 URL: http://llvm.org/viewvc/llvm-project?rev=291427&view=rev Log: Implement C++ DR1391 (wg21.link/cwg1391) Check for implicit conversion sequences for non-dependent function template parameters between deduction and substitution.

Re: r291416 - [cxx1z-constexpr-lambda] Implement constant evaluation of non-capturing lambda expressions.

2017-01-09 Thread Richard Smith via cfe-commits
On 9 January 2017 at 03:44, Faisal Vali wrote: > On Mon, Jan 9, 2017 at 12:13 AM, Richard Smith > wrote: > > On 8 January 2017 at 19:02, Faisal Vali via cfe-commits > > wrote: > >> > >> Author: faisalv > >> Date: Sun Jan 8 21:02:53 2017 > >&g

r291484 - PR31587: Fix handling of __FUNCSIG__ in C.

2017-01-09 Thread Richard Smith via cfe-commits
Author: rsmith Date: Mon Jan 9 15:40:40 2017 New Revision: 291484 URL: http://llvm.org/viewvc/llvm-project?rev=291484&view=rev Log: PR31587: Fix handling of __FUNCSIG__ in C. Fix crash if __FUNCSIG__ is used in a function without a prototype, and use "(void)" as parameter list instead of "()" fo

r291489 - MSVC seems to use (void) in __FUNCSIG__ for a zero-parameter function even in C++. Follow suit.

2017-01-09 Thread Richard Smith via cfe-commits
Author: rsmith Date: Mon Jan 9 16:16:16 2017 New Revision: 291489 URL: http://llvm.org/viewvc/llvm-project?rev=291489&view=rev Log: MSVC seems to use (void) in __FUNCSIG__ for a zero-parameter function even in C++. Follow suit. Modified: cfe/trunk/lib/AST/Expr.cpp cfe/trunk/test/CodeGen

r291512 - Check that template template arguments match template template parameters

2017-01-09 Thread Richard Smith via cfe-commits
Author: rsmith Date: Mon Jan 9 17:54:33 2017 New Revision: 291512 URL: http://llvm.org/viewvc/llvm-project?rev=291512&view=rev Log: Check that template template arguments match template template parameters properly even when a non-type template parameter has a dependent type. Previously, if a no

r291528 - Don't classify variable template names as type templates.

2017-01-09 Thread Richard Smith via cfe-commits
Author: rsmith Date: Mon Jan 9 20:15:49 2017 New Revision: 291528 URL: http://llvm.org/viewvc/llvm-project?rev=291528&view=rev Log: Don't classify variable template names as type templates. Modified: cfe/trunk/lib/Sema/SemaDecl.cpp cfe/trunk/test/SemaCXX/cxx1y-variable-templates_top_leve

r291551 - Fix rejects-valid with default member initializers exposed by r291318.

2017-01-10 Thread Richard Smith via cfe-commits
Author: rsmith Date: Tue Jan 10 02:51:46 2017 New Revision: 291551 URL: http://llvm.org/viewvc/llvm-project?rev=291551&view=rev Log: Fix rejects-valid with default member initializers exposed by r291318. Don't prematurely clean up an RAII object; there's another RAII object in the same scope that

r291596 - Fix conversion index / argument index mismatch when diagnosing overload resolution failure.

2017-01-10 Thread Richard Smith via cfe-commits
Author: rsmith Date: Tue Jan 10 14:19:21 2017 New Revision: 291596 URL: http://llvm.org/viewvc/llvm-project?rev=291596&view=rev Log: Fix conversion index / argument index mismatch when diagnosing overload resolution failure. Modified: cfe/trunk/lib/Sema/SemaOverload.cpp cfe/trunk/test/Se

r291597 - Don't try to check implicit conversion sequences for an object argument if

2017-01-10 Thread Richard Smith via cfe-commits
Author: rsmith Date: Tue Jan 10 14:52:50 2017 New Revision: 291597 URL: http://llvm.org/viewvc/llvm-project?rev=291597&view=rev Log: Don't try to check implicit conversion sequences for an object argument if there is no object argument, when early checking of implicit conversion sequences for a fu

r291608 - Remove a couple of parameters that are always false.

2017-01-10 Thread Richard Smith via cfe-commits
Author: rsmith Date: Tue Jan 10 16:59:18 2017 New Revision: 291608 URL: http://llvm.org/viewvc/llvm-project?rev=291608&view=rev Log: Remove a couple of parameters that are always false. Modified: cfe/trunk/include/clang/Parse/Parser.h cfe/trunk/lib/Parse/Parser.cpp Modified: cfe/trunk/in

r291610 - Remove dead code.

2017-01-10 Thread Richard Smith via cfe-commits
Author: rsmith Date: Tue Jan 10 17:04:46 2017 New Revision: 291610 URL: http://llvm.org/viewvc/llvm-project?rev=291610&view=rev Log: Remove dead code. Modified: cfe/trunk/lib/Parse/Parser.cpp Modified: cfe/trunk/lib/Parse/Parser.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Par

Re: r291628 - Module: Do not create Implicit ImportDecl for module X if we

2017-01-10 Thread Richard Smith via cfe-commits
On 10 January 2017 at 16:48, Manman Ren via cfe-commits < cfe-commits@lists.llvm.org> wrote: > Author: mren > Date: Tue Jan 10 18:48:19 2017 > New Revision: 291628 > > URL: http://llvm.org/viewvc/llvm-project?rev=291628&view=rev > Log: > Module: Do not create Implicit ImportDecl for module X if we

Re: r291628 - Module: Do not create Implicit ImportDecl for module X if we

2017-01-10 Thread Richard Smith via cfe-commits
On 10 January 2017 at 17:57, Richard Smith wrote: > On 10 January 2017 at 16:48, Manman Ren via cfe-commits < > cfe-commits@lists.llvm.org> wrote: > >> Author: mren >> Date: Tue Jan 10 18:48:19 2017 >> New Revision: 291628 >> >> URL: http://llvm.org/v

Re: r291689 - Module: Do not add any link flags when an implementation TU of a module imports

2017-01-11 Thread Richard Smith via cfe-commits
Thank you! On 11 January 2017 at 10:47, Manman Ren via cfe-commits < cfe-commits@lists.llvm.org> wrote: > Author: mren > Date: Wed Jan 11 12:47:38 2017 > New Revision: 291689 > > URL: http://llvm.org/viewvc/llvm-project?rev=291689&view=rev > Log: > Module: Do not add any link flags when an implem

r291737 - Remove redundant passing around of a "ContainsAutoType" flag.

2017-01-11 Thread Richard Smith via cfe-commits
Author: rsmith Date: Wed Jan 11 20:27:38 2017 New Revision: 291737 URL: http://llvm.org/viewvc/llvm-project?rev=291737&view=rev Log: Remove redundant passing around of a "ContainsAutoType" flag. This flag serves no purpose other than to prevent us walking through a type to check whether it contai

Re: [PATCH] D23385: Implement __attribute__((require_constant_initialization)) for safe static initialization.

2016-08-15 Thread Richard Smith via cfe-commits
rsmith added inline comments. Comment at: include/clang/Basic/Attr.td:1384 @@ +1383,3 @@ +def RequireConstantInit : InheritableAttr { + let Spellings = [GCC<"require_constant_initialization">, + CXX11<"clang", "require_constant_initialization">]; ---

Re: [PATCH] D23453: Add a c2x language mode

2016-08-15 Thread Richard Smith via cfe-commits
rsmith added a comment. This seems premature; according to the charter, we are more than three years away from the C2x committee draft phase. Perhaps we should wait until we have either a new working draft or a paper approved by the WG14 for such a working draft. https://reviews.llvm.org/D234

Re: [PATCH] D23385: Implement __attribute__((require_constant_initialization)) for safe static initialization.

2016-08-15 Thread Richard Smith via cfe-commits
rsmith added inline comments. Comment at: include/clang/Basic/AttrDocs.td:858 @@ +857,3 @@ + }; + SAFE_STATIC T x = {42}; // OK. + SAFE_STATIC T y = 42; // error: variable does not have a constant initializer Sure, if that's a conscious design decision for the

r278763 - PR28978: If we need overload resolution for the move constructor of an

2016-08-15 Thread Richard Smith via cfe-commits
Author: rsmith Date: Mon Aug 15 19:13:47 2016 New Revision: 278763 URL: http://llvm.org/viewvc/llvm-project?rev=278763&view=rev Log: PR28978: If we need overload resolution for the move constructor of an anonymous union member of a class, we need overload resolution for the move constructor of the

Re: [PATCH] D23385: Implement __attribute__((require_constant_initialization)) for safe static initialization.

2016-08-15 Thread Richard Smith via cfe-commits
rsmith added inline comments. Comment at: lib/Sema/SemaDecl.cpp:10519-10520 @@ +10518,4 @@ + auto *CE = dyn_cast(Init); + bool DiagErr = (var->isInitKnownICE() || (CE && CE->getConstructor()->isConstexpr())) + ? !var->checkInitIsICE() : !checkConstInit(); +

Re: [PATCH] D22794: [Sema] Propagate nullability when deducing type of auto

2016-08-15 Thread Richard Smith via cfe-commits
rsmith added a subscriber: rsmith. rsmith added a comment. Is this really a good idea? If I write: int *_Nullable f(); int n; int *_Nonnull g() { auto *p = f(); if (!p) p = &n; return p; } ... it would be wrong to produce a warning that I'm converting from a nullable pointer

Re: r278763 - PR28978: If we need overload resolution for the move constructor of an

2016-08-15 Thread Richard Smith via cfe-commits
Hi Hans, Eric Fiselier requested that we fix this bug for 3.9 (it affects libc++'s std::optional implementation), so this would be a good candidate for the branch. On Mon, Aug 15, 2016 at 5:13 PM, Richard Smith via cfe-commits < cfe-commits@lists.llvm.org> wrote: > Author: rsmith &

r278882 - If possible, set the stack rlimit to at least 8MiB on cc1 startup, and work

2016-08-16 Thread Richard Smith via cfe-commits
Author: rsmith Date: Tue Aug 16 20:05:07 2016 New Revision: 278882 URL: http://llvm.org/viewvc/llvm-project?rev=278882&view=rev Log: If possible, set the stack rlimit to at least 8MiB on cc1 startup, and work around a Linux kernel bug where the actual amount of available stack may be a *lot* lower

Re: Nomination for 3.9: r278786 - Left shifts of negative values are defined if -fwrapv is set

2016-08-16 Thread Richard Smith via cfe-commits
Looks fine to me. (At one point we were deliberately not following GCC in making -fwrapv affect left shift, because it's a bit operation rather than an arithmetic one, but this is ultimately supposed to be a GCC-compatible flag so behaving as they do seems reasonable.) On Tue, Aug 16, 2016 at 9:38

<    14   15   16   17   18   19   20   21   22   23   >