Re: [PATCH] D25060: [Coroutines] Fix assertion about uncorrected typos in co_await/co_yield/co_return expressions.

2016-09-29 Thread Richard Smith via cfe-commits
LGTM On Wed, Sep 28, 2016 at 10:09 PM, Eric Fiselier wrote: > EricWF created this revision. > EricWF added reviewers: rsmith, GorNishanov. > EricWF added a subscriber: cfe-commits. > Herald added a subscriber: mehdi_amini. > > If there is an error finding the `coroutine_traits` template when bui

r282777 - Switch to a different workaround for unimplementability of P0145R3 in MS ABIs.

2016-09-29 Thread Richard Smith via cfe-commits
Author: rsmith Date: Thu Sep 29 16:30:12 2016 New Revision: 282777 URL: http://llvm.org/viewvc/llvm-project?rev=282777&view=rev Log: Switch to a different workaround for unimplementability of P0145R3 in MS ABIs. Instead of ignoring the evaluation order rule, ignore the "destroy parameters in rever

r282800 - P0035R4: add std::align_val_t overloads of operator new/delete in C++17 mode.

2016-09-29 Thread Richard Smith via cfe-commits
Author: rsmith Date: Thu Sep 29 17:49:46 2016 New Revision: 282800 URL: http://llvm.org/viewvc/llvm-project?rev=282800&view=rev Log: P0035R4: add std::align_val_t overloads of operator new/delete in C++17 mode. Added: cfe/trunk/test/PCH/cxx1z-aligned-alloc.cpp Modified: cfe/trunk/include/

Re: [PATCH] [coroutines] Rename driver flag -fcoroutines to -fcoroutines-ts

2016-09-29 Thread Richard Smith via cfe-commits
+def fcoroutines : Flag <["-"], "fcoroutines-ts">, Group, + Flags<[DriverOption, CC1Option]>, + HelpText<"Enable support for the C++ Coroutines TS">; +def fno_coroutines : Flag <["-"], "fno-coroutines-ts">, Group, These should be named fcoroutines_ts, fno_coroutines_ts (see comment at the top of

[PATCH] D25078: [coroutines] Diagnose when 'main' is declared as a coroutine.

2016-09-30 Thread Richard Smith via cfe-commits
rsmith added a comment. LGTM, go ahead when Gor is happy. https://reviews.llvm.org/D25078 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D25131: Fix PR 28885: Fix AST Printer output for inheriting constructor using declarations

2016-09-30 Thread Richard Smith via cfe-commits
rsmith accepted this revision. rsmith added a comment. This revision is now accepted and ready to land. Minor comment, otherwise LGTM. > DeclPrinter.cpp:1350-1351 > + > + // PR 28885: Use the correct record name when the using declaration is used > + // for inheriting constructors. > + for (

r282974 - P0035R4: add predefined __STDCPP_DEFAULT_NEW_ALIGNMENT__ macro. By default, we

2016-09-30 Thread Richard Smith via cfe-commits
Author: rsmith Date: Fri Sep 30 17:41:36 2016 New Revision: 282974 URL: http://llvm.org/viewvc/llvm-project?rev=282974&view=rev Log: P0035R4: add predefined __STDCPP_DEFAULT_NEW_ALIGNMENT__ macro. By default, we assume that ::operator new provides no more alignment than is necessary for any primit

r282981 - Fix bogus "inline namespace cannot be reopened as non-inline" diagnostic to

2016-09-30 Thread Richard Smith via cfe-commits
Author: rsmith Date: Fri Sep 30 18:16:08 2016 New Revision: 282981 URL: http://llvm.org/viewvc/llvm-project?rev=282981&view=rev Log: Fix bogus "inline namespace cannot be reopened as non-inline" diagnostic to just warn that the second declaration is missing the 'inline' keyword. This is valid, and

[PATCH] D25068: [coroutines] Switch to using std::experimental namespace per P0057R5

2016-09-30 Thread Richard Smith via cfe-commits
rsmith added inline comments. > SemaDeclCXX.cpp:8157-8160 > + CurContext->getRedeclContext()->isStdNamespace()) { > + PrevNS = getStdExperimentalNamespace(); > + IsStdExperimental = true; > + AddToKnown = !IsInline; If you're going to track the namespace on creation,

[clang-tools-extra] r282984 - Fix tests to not assume they know exactly what will be in Clang's predefines buffer.

2016-09-30 Thread Richard Smith via cfe-commits
Author: rsmith Date: Fri Sep 30 18:47:58 2016 New Revision: 282984 URL: http://llvm.org/viewvc/llvm-project?rev=282984&view=rev Log: Fix tests to not assume they know exactly what will be in Clang's predefines buffer. Modified: clang-tools-extra/trunk/test/pp-trace/pp-trace-conditional.cpp

[PATCH] D25130: [coroutines] Rename driver flag -fcoroutines to -fcoroutines-ts

2016-10-01 Thread Richard Smith via cfe-commits
rsmith accepted this revision. rsmith added a comment. This revision is now accepted and ready to land. One question, but otherwise this looks fine. > coroutines.m:1 > +// RUN: %clang -### %s 2>&1 | FileCheck -check-prefix=CHECK-NO-CORO %s > +// RUN: %clang -fcoroutines-ts -### %s 2>&1 | FileCh

[PATCH] D25068: [coroutines] Switch to using std::experimental namespace per P0057R5

2016-10-03 Thread Richard Smith via cfe-commits
rsmith accepted this revision. rsmith added inline comments. > Sema.h:720-723 > + /// \brief The C++ "std::experimental" namespace, where the experimental > parts > + /// of the standard library resides. > + NamespaceDecl *StdExperimentalNamespace; > + This is in the middle of a block of imp

[PATCH] D24373: [coroutines] Adding builtins for coroutine intrinsics and backendutil support.

2016-10-03 Thread Richard Smith via cfe-commits
rsmith added inline comments. > LanguageExtensions.rst:1886 > + bool __builtin_coro_done(void *addr); > + void __builtin_coro_promise(void *addr, int alignment, bool from_promise) > + Return type here is `void*`, not `void`. > LanguageExtensions.rst:1916 > + > +Other coroutine builtins are ei

[PATCH] D24693: [CodeGen] Don't emit lifetime intrinsics for some local variables

2016-10-03 Thread Richard Smith via cfe-commits
rsmith added a comment. I'm concerned about the complexity of this approach; it's hard for me to be confident that `BuildScopeInformation` is correct and will remain correct in the presence of future changes to the AST, and if it's not, we'll potentially silently miscompile. A simpler but less

[PATCH] D24693: [CodeGen] Don't emit lifetime intrinsics for some local variables

2016-10-03 Thread Richard Smith via cfe-commits
rsmith added a comment. OK, so it seems like all the other approaches we discussed have problems too. Let's move forward with this for now. Is there some reasonable base set of functionality between this and JumpDiagnostics that could be factored out and shared? > VarBypassDetector.cpp:45 >

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

2016-10-03 Thread Richard Smith via cfe-commits
rsmith accepted this revision. rsmith added a comment. This revision is now accepted and ready to land. A couple of comment nits, then this LGTM. Thanks! > SemaDecl.cpp:8659-8664 > + // void func(); > + // template class C1 { friend void func() { } }; > + // template class

[PATCH] D25213: Fix PR28181: Prevent operator overloading related assertion failure crash that happens in C only

2016-10-03 Thread Richard Smith via cfe-commits
rsmith added inline comments. > SemaOverload.cpp:11750 > ExprResult > Sema::CreateOverloadedBinOp(SourceLocation OpLoc, > BinaryOperatorKind Opc, We should never be calling this function outside of C++ mode. It looks like the bug is in `Sema::BuildBinOp` -- in C,

[PATCH] D23657: Remove some false positives when taking the address of packed members

2016-10-03 Thread Richard Smith via cfe-commits
rsmith added inline comments. > SemaChecking.cpp:11053-11056 > + if ((RequiredAlignment > AlignRecord) || > + ((Context.toCharUnitsFromBits( > +Context.getFieldOffset(cast(MD))) % > +RequiredAlignment) != 0)) { This doesn't seem to correctly handle the c

[PATCH] D25153: preprocessor supports `-dI` flag

2016-10-03 Thread Richard Smith via cfe-commits
rsmith added inline comments. > PrintPreprocessedOutput.cpp:320-321 > + * if we're emitting a '#'-style directive (escape both CR and LF). Paths > are quoted in some > + * instances, so escape quotes. Escaping is with a backslash (and > backslashes themselves have > + * to be escaped); for CR

[PATCH] D21675: New ODR checker for modules

2016-10-03 Thread Richard Smith via cfe-commits
rsmith added a comment. There are a bunch of cases here that do this: if (auto t = getThing()) ID.addThing(t); if (auto t = getOtherThing()) ID.addThing(t); That will result in hash collisions between objects with thing and objects with otherthing (for instance, `struct A { int n :

[PATCH] D24969: [Sema] Use the instantiated name of destructors in FindInstantiatedDecl and RebuildMemberExpr

2016-10-04 Thread Richard Smith via cfe-commits
rsmith added inline comments. > SemaTemplateInstantiateDecl.cpp:4849 > + DeclarationName Name = D->getDeclName(); > + if (auto *DD = dyn_cast(D)) > +Name = Do we need to do this for conversion function names too? (Eg, `operator C1*`) https://reviews.llvm.org/D24969

[PATCH] D25153: preprocessor supports `-dI` flag

2016-10-04 Thread Richard Smith via cfe-commits
rsmith added inline comments. > PrintPreprocessedOutput.cpp:328 > + case '"': // paths are enclosed in quotes; escape them > + case '*': // don't allow a "*/" sequence to accidentally open the > comment > + case '\\': // escape the escape character itself. Putting a \ before a

Re: [PATCH] D25199: [ubsan] Sanitize deleted pointers

2016-10-04 Thread Richard Smith via cfe-commits
On Mon, Oct 3, 2016 at 2:59 PM, Peter Collingbourne wrote: > pcc added a reviewer: rsmith. > pcc added a comment. > > It seems to me that this sanitizer would break the semantics of otherwise > well-defined programs. For example: > > int *x = nullptr; > delete x; > if (x != nullptr) { >

[PATCH] D24508: PR28752: Do not instantiate var decls which are not visible.

2016-10-05 Thread Richard Smith via cfe-commits
rsmith added a comment. This looks like it's going in the right direction. > Decl.cpp:2269-2272 > + // If we have hit a point where the user provided a specialization of > + // this template, we're done looking. > + if (VarTemplate->isMemberSpecialization()) > +break; I

r283406 - PR22924, PR22845, some of CWG1464: When checking the initializer for an array

2016-10-05 Thread Richard Smith via cfe-commits
Author: rsmith Date: Wed Oct 5 17:41:02 2016 New Revision: 283406 URL: http://llvm.org/viewvc/llvm-project?rev=283406&view=rev Log: PR22924, PR22845, some of CWG1464: When checking the initializer for an array new expression, distinguish between the case of a constant and non-constant initializer

Re: r283460 - [OpenMP] Check if the template specialization is mappable instead of specialized template Differential Revision: https://reviews.llvm.org/D25252

2016-10-06 Thread Richard Smith via cfe-commits
LGTM On 6 Oct 2016 8:58 am, "David Sheinkman via cfe-commits" < cfe-commits@lists.llvm.org> wrote: > Author: davidsh > Date: Thu Oct 6 10:47:36 2016 > New Revision: 283460 > > URL: http://llvm.org/viewvc/llvm-project?rev=283460&view=rev > Log: > [OpenMP] Check if the template specialization is m

r283489 - [modules] Be sure to emit local specializations of imported templates, even if

2016-10-06 Thread Richard Smith via cfe-commits
Author: rsmith Date: Thu Oct 6 15:30:51 2016 New Revision: 283489 URL: http://llvm.org/viewvc/llvm-project?rev=283489&view=rev Log: [modules] Be sure to emit local specializations of imported templates, even if the resulting specialization is not referenced by the rest of the AST. This both avoid

[PATCH] D24508: PR28752: Do not instantiate var decls which are not visible.

2016-10-06 Thread Richard Smith via cfe-commits
rsmith added inline comments. > SemaDecl.cpp:3692-3693 > + // Demote the newly parsed definition to a fake declaration. > + // FIXME: Sema::AddInitializationToDecl still allows two definitions, > + // which make the AST variants inconsistent. > + assert (Def != New && "There i

r283498 - Add another .def file to module map to fix modules buildbot's displeasure.

2016-10-06 Thread Richard Smith via cfe-commits
Author: rsmith Date: Thu Oct 6 16:31:04 2016 New Revision: 283498 URL: http://llvm.org/viewvc/llvm-project?rev=283498&view=rev Log: Add another .def file to module map to fix modules buildbot's displeasure. Modified: cfe/trunk/include/clang/module.modulemap Modified: cfe/trunk/include/clang

r283508 - PR25890: Fix incoherent error handling in PerformImplicitConversion and

2016-10-06 Thread Richard Smith via cfe-commits
Author: rsmith Date: Thu Oct 6 18:12:58 2016 New Revision: 283508 URL: http://llvm.org/viewvc/llvm-project?rev=283508&view=rev Log: PR25890: Fix incoherent error handling in PerformImplicitConversion and CheckSingleAssignmentConstraints. These no longer produce ExprError() when they have not emit

[PATCH] D25001: [Module] Merge function prototype with a non-prototype function declaration

2016-10-07 Thread Richard Smith via cfe-commits
rsmith added a comment. I'm concerned that name lookup will find an inappropriate declaration after this merging. If we have two visible declarations of a function in the same scope, and one has a prototype but the other does not, the user should be able to rely on the prototype being used. `is

[PATCH] D24975: [CUDA] Add #pragma clang force_cuda_host_device_{begin, end} pragmas.

2016-10-07 Thread Richard Smith via cfe-commits
rsmith accepted this revision. rsmith added a comment. This revision is now accepted and ready to land. Please add a test to test/PCH for the serialization code. Otherwise, LGTM. Comment at: clang/include/clang/Basic/DiagnosticParseKinds.td:1032 + "force_cuda_host_device end

[PATCH] D25361: [libcxx] Add the missing limits.h header

2016-10-07 Thread Richard Smith via cfe-commits
rsmith added a comment. I only skipped this one because it seemed pointless to me. I have no objection to providing it, and this change makes perfect sense if libc++ wants to guarantee that `<__config>` is included whenever any standard C++ header is included. https://reviews.llvm.org/D25361

r283724 - Mark aligned allocation as done.

2016-10-10 Thread Richard Smith via cfe-commits
Author: rsmith Date: Mon Oct 10 01:55:42 2016 New Revision: 283724 URL: http://llvm.org/viewvc/llvm-project?rev=283724&view=rev Log: Mark aligned allocation as done. Modified: cfe/trunk/lib/Frontend/InitPreprocessor.cpp cfe/trunk/test/Lexer/cxx-features.cpp cfe/trunk/www/cxx_status.ht

r283789 - Re-commit r283722, reverted in r283750, with a fix for a CUDA-specific use of

2016-10-10 Thread Richard Smith via cfe-commits
Author: rsmith Date: Mon Oct 10 13:54:32 2016 New Revision: 283789 URL: http://llvm.org/viewvc/llvm-project?rev=283789&view=rev Log: Re-commit r283722, reverted in r283750, with a fix for a CUDA-specific use of past-the-end iterator. Original commit message: P0035R4: Semantic analysis and code g

Re: [PATCH] D25308: [Sema] Ignore transparent_union attributes in C++

2016-10-10 Thread Richard Smith via cfe-commits
On Mon, Oct 10, 2016 at 10:45 AM, Hal Finkel via cfe-commits < cfe-commits@lists.llvm.org> wrote: > hfinkel added a comment. > > In https://reviews.llvm.org/D25308#566176, @arphaman wrote: > > > The updated patch now makes clang warn every time it encounters this > attribute in C++ mode. Would tha

[PATCH] D24508: PR28752: Do not instantiate var decls which are not visible.

2016-10-10 Thread Richard Smith via cfe-commits
rsmith accepted this revision. rsmith added inline comments. This revision is now accepted and ready to land. Comment at: include/clang/AST/Decl.h:1222 + void demoteThisDefinitionToDeclaration() { +assert (!isThisDeclarationADemotedDefinition() && "Aleady demoted!"); +as

[PATCH] D25225: Add an option to save the backend-produced YAML optimization record to a file

2016-10-10 Thread Richard Smith via cfe-commits
rsmith added a comment. As discussed on IRC, I have a mild concern about using `-fsave-optimization-record` (with no argument) to enable the feature, and `-fsave-optimization-record=X` to enable the feature and specify a filename; in most (but not all) cases, `-option arg` and `-option=arg` mea

r283830 - Aligned allocation versus CUDA: make deallocation function preference order

2016-10-10 Thread Richard Smith via cfe-commits
Author: rsmith Date: Mon Oct 10 19:21:10 2016 New Revision: 283830 URL: http://llvm.org/viewvc/llvm-project?rev=283830&view=rev Log: Aligned allocation versus CUDA: make deallocation function preference order match other CUDA preference orders, per discussion with jlebar. We now model this in an a

[PATCH] D25458: Don't create builtin declaration when looking for typo corrections in C++

2016-10-10 Thread Richard Smith via cfe-commits
rsmith added a comment. It sounds like this will hinder our ability to typo-correct to builtins. I think we only want to suppress implicitly declaring *library* builtins here (those that are expected to be provided by a header), not all builtins. https://reviews.llvm.org/D25458

[PATCH] D24508: PR28752: Do not instantiate var decls which are not visible.

2016-10-11 Thread Richard Smith via cfe-commits
rsmith added inline comments. Comment at: include/clang/AST/Decl.h:1213 + bool isThisDeclarationADemotedDefinition() const { +return NonParmVarDeclBits.IsThisDeclarationADemotedDefinition; + } This is the bug. You can't read this bit here without first chec

[PATCH] D24969: [Sema] Use the instantiated name of destructors in FindInstantiatedDecl and RebuildMemberExpr

2016-10-11 Thread Richard Smith via cfe-commits
rsmith added inline comments. Comment at: lib/Sema/SemaTemplateInstantiateDecl.cpp:4849 + DeclarationName Name = D->getDeclName(); + if (auto *DD = dyn_cast(D)) +Name = ahatanak wrote: > rsmith wrote: > > Do we need to do this for conversion fun

[PATCH] D23657: Remove some false positives when taking the address of packed members

2016-10-11 Thread Richard Smith via cfe-commits
rsmith added inline comments. Comment at: lib/Sema/SemaChecking.cpp:11356-11357 + // Compute the EffectiveAlignment as the alignment of the whole chain. + CharUnits EffectiveAlignment = Context.getTypeAlignInChars( + ReverseMemberChain.back()->getParent()->getTypeForDecl()

r284081 - Revert r284008. This is us to fail to instantiate static data members in some

2016-10-12 Thread Richard Smith via cfe-commits
Author: rsmith Date: Wed Oct 12 18:29:02 2016 New Revision: 284081 URL: http://llvm.org/viewvc/llvm-project?rev=284081&view=rev Log: Revert r284008. This is us to fail to instantiate static data members in some cases. I'm working on reducing a testcase. Removed: cfe/trunk/test/Modules/Inputs/

Re: [PATCH] D25539: [Coverage] Support for C++17 switch initializers

2016-10-12 Thread Richard Smith via cfe-commits
Do we need the same change for if-statements too? On 12 Oct 2016 6:26 pm, "Vedant Kumar via cfe-commits" < cfe-commits@lists.llvm.org> wrote: > vsk created this revision. > vsk added reviewers: arphaman, ikudrin. > vsk added a subscriber: cfe-commits. > > Generate coverage mappings for in switch

Re: r276159 - [modules] Don't emit initializers for VarDecls within a module eagerly whenever

2016-10-13 Thread Richard Smith via cfe-commits
t; > On Jul 20, 2016, at 12:10 PM, Richard Smith via cfe-commits < > cfe-commits@lists.llvm.org> wrote: > > > > Author: rsmith > > Date: Wed Jul 20 14:10:16 2016 > > New Revision: 276159 > > > > URL: http://llvm.org/viewvc/llvm-project?rev=276159&view=re

r284176 - Reinstate r281429, reverted in r281452, with a fix for its mishandling of

2016-10-13 Thread Richard Smith via cfe-commits
Author: rsmith Date: Thu Oct 13 18:04:14 2016 New Revision: 284176 URL: http://llvm.org/viewvc/llvm-project?rev=284176&view=rev Log: Reinstate r281429, reverted in r281452, with a fix for its mishandling of compiles without -fmodules-local-submodule-visibility. Original commit message: [modules]

[PATCH] D25581: Implement __builtin_alloca_with_align for GCC compatibility

2016-10-13 Thread Richard Smith via cfe-commits
rsmith added inline comments. Comment at: lib/CodeGen/CGBuiltin.cpp:1037-1039 +llvm::APSInt AlignInBits; +if (!E->getArg(1)->EvaluateAsInt(AlignInBits, CGM.getContext())) + break; This takes the alignment in **bits**? That's so ridiculously dumb that

r284184 - Use SubstInitializer instead of SubstExpr when instantiating a default

2016-10-13 Thread Richard Smith via cfe-commits
Author: rsmith Date: Thu Oct 13 20:12:20 2016 New Revision: 284184 URL: http://llvm.org/viewvc/llvm-project?rev=284184&view=rev Log: Use SubstInitializer instead of SubstExpr when instantiating a default argument, in order to correctly instantiate the initializer. Modified: cfe/trunk/lib/Sema

r284187 - Fix bogus assert breaking modules self-host.

2016-10-13 Thread Richard Smith via cfe-commits
Author: rsmith Date: Thu Oct 13 21:35:11 2016 New Revision: 284187 URL: http://llvm.org/viewvc/llvm-project?rev=284187&view=rev Log: Fix bogus assert breaking modules self-host. Modified: cfe/trunk/lib/AST/ASTContext.cpp Modified: cfe/trunk/lib/AST/ASTContext.cpp URL: http://llvm.org/viewvc

Re: [libcxx] r284210 - XFAIL aligned allocation test failures with UBSAN

2016-10-14 Thread Richard Smith via cfe-commits
On Fri, Oct 14, 2016 at 12:49 AM, Eric Fiselier via cfe-commits < cfe-commits@lists.llvm.org> wrote: > Author: ericwf > Date: Fri Oct 14 02:49:15 2016 > New Revision: 284210 > > URL: http://llvm.org/viewvc/llvm-project?rev=284210&view=rev > Log: > XFAIL aligned allocation test failures with UBSAN

r284271 - [linux] When pre-reserving stack pages to work around broken address space

2016-10-14 Thread Richard Smith via cfe-commits
Author: rsmith Date: Fri Oct 14 14:51:36 2016 New Revision: 284271 URL: http://llvm.org/viewvc/llvm-project?rev=284271&view=rev Log: [linux] When pre-reserving stack pages to work around broken address space layout for PIE binaries, ask the OS how much stack space is already in use to avoid stack

r284284 - Reinstate r284008 reverted in r284081, with two fixes:

2016-10-14 Thread Richard Smith via cfe-commits
Author: rsmith Date: Fri Oct 14 16:41:24 2016 New Revision: 284284 URL: http://llvm.org/viewvc/llvm-project?rev=284284&view=rev Log: Reinstate r284008 reverted in r284081, with two fixes: 1) Merge and demote variable definitions when we find a redefinition in MergeVarDecls, not only when we find

[PATCH] D24508: PR28752: Do not instantiate var decls which are not visible.

2016-10-14 Thread Richard Smith via cfe-commits
rsmith added a comment. I reverted this in r284081, and relanded with fixes described here as r284284. Comment at: lib/Sema/SemaDecl.cpp:9712 + + // Demote the newly parsed definition to a fake declaration. + if (!VDecl->isThisDeclarationADemotedDefinition())

Re: [libcxx] r249738 - Split out of .

2016-10-14 Thread Richard Smith via cfe-commits
On Fri, Oct 14, 2016 at 11:44 AM, Bruno Cardoso Lopes < bruno.card...@gmail.com> wrote: > Hi Richard, > > I have a patch on top of your suggested patch from a year ago, that > break the cyclic dependency we're seeing, with this (and a few changes > to the SDK) we can bootstrap clang with submodule

Re: [libcxx] r284210 - XFAIL aligned allocation test failures with UBSAN

2016-10-14 Thread Richard Smith via cfe-commits
Oh, I have another idea: could it be that you're also turning some optimization on when UBSan is enabled? Note that the operator new/operator delete pair is elidable in each of these tests, and Clang will remove the calls when compiling with optimizations enabled. On Fri, Oct 14, 2016 at 2:38 PM,

Re: [libcxx] r284210 - XFAIL aligned allocation test failures with UBSAN

2016-10-14 Thread Richard Smith via cfe-commits
On Fri, Oct 14, 2016 at 3:34 PM, Eric Fiselier via cfe-commits < cfe-commits@lists.llvm.org> wrote: > Oh, I have another idea: could it be that you're also turning some > optimization on when UBSan is enabled? Note that the operator new/operator > delete pair is elidable in each of these tests, an

r284300 - Disable a silly GCC diagnostic for combining a scanf length specifier with the

2016-10-14 Thread Richard Smith via cfe-commits
Author: rsmith Date: Fri Oct 14 20:59:52 2016 New Revision: 284300 URL: http://llvm.org/viewvc/llvm-project?rev=284300&view=rev Log: Disable a silly GCC diagnostic for combining a scanf length specifier with the '*' specifier. Apparently the GNU folks want to discourage self-documenting code. Mod

[PATCH] D25153: preprocessor supports `-dI` flag

2016-10-15 Thread Richard Smith via cfe-commits
rsmith accepted this revision. rsmith added a comment. This revision is now accepted and ready to land. Thanks for your patience, this looks great to me. Do you need someone to commit this for you? https://reviews.llvm.org/D25153 ___ cfe-commits ma

r284331 - Extend this test and make it a bit clearer which cases Clang is getting wrong.

2016-10-15 Thread Richard Smith via cfe-commits
Author: rsmith Date: Sun Oct 16 01:23:29 2016 New Revision: 284331 URL: http://llvm.org/viewvc/llvm-project?rev=284331&view=rev Log: Extend this test and make it a bit clearer which cases Clang is getting wrong. Modified: cfe/trunk/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.conv/p4.c

[PATCH] D25654: [Sema] Don't perform aggregate initialization for types with explicit constructors

2016-10-16 Thread Richard Smith via cfe-commits
rsmith added a comment. Please also add a test to test/CXX/drs/dr15xx.cpp for core issue 1518, which this paper was resolving. Comment at: lib/AST/DeclCXX.cpp:564 +// C++1z [dcl.init.aggr]p1: +// - no user-provided, explicit, or inherited constructors, +if (getAST

r284337 - P0012R1: Make exception specifications be part of the type system. This

2016-10-16 Thread Richard Smith via cfe-commits
Author: rsmith Date: Sun Oct 16 12:54:23 2016 New Revision: 284337 URL: http://llvm.org/viewvc/llvm-project?rev=284337&view=rev Log: P0012R1: Make exception specifications be part of the type system. This implements the bulk of the change (modifying the type system to include exception specificati

r319408 - Preserve the "last diagnostic was suppressed" flag across SFINAE checks.

2017-11-30 Thread Richard Smith via cfe-commits
Author: rsmith Date: Thu Nov 30 00:18:21 2017 New Revision: 319408 URL: http://llvm.org/viewvc/llvm-project?rev=319408&view=rev Log: Preserve the "last diagnostic was suppressed" flag across SFINAE checks. Sometimes we check the validity of some construct between producing a diagnostic and produc

r319495 - Update website to mention that you still need -frelaxed-template-template-args to enable the corresponding C++17 feature in Clang 5.

2017-11-30 Thread Richard Smith via cfe-commits
Author: rsmith Date: Thu Nov 30 15:07:29 2017 New Revision: 319495 URL: http://llvm.org/viewvc/llvm-project?rev=319495&view=rev Log: Update website to mention that you still need -frelaxed-template-template-args to enable the corresponding C++17 feature in Clang 5. Modified: cfe/trunk/www/cx

r319509 - [c++2a] P0515R3: lexer support for new <=> token.

2017-11-30 Thread Richard Smith via cfe-commits
Author: rsmith Date: Thu Nov 30 17:07:10 2017 New Revision: 319509 URL: http://llvm.org/viewvc/llvm-project?rev=319509&view=rev Log: [c++2a] P0515R3: lexer support for new <=> token. Added: cfe/trunk/test/Lexer/cxx2a-spaceship.cpp Modified: cfe/trunk/include/clang/Basic/DiagnosticLexKinds

r319513 - [c++2a] P0515R3: Support for overloaded operator<=>.

2017-11-30 Thread Richard Smith via cfe-commits
Author: rsmith Date: Thu Nov 30 18:13:10 2017 New Revision: 319513 URL: http://llvm.org/viewvc/llvm-project?rev=319513&view=rev Log: [c++2a] P0515R3: Support for overloaded operator<=>. No CodeGen support for MSABI yet, we don't know how to mangle this there. Added: cfe/trunk/test/CodeGenCXX

r319584 - [c++17] When deducing the type of a non-type template parameter from the type

2017-12-01 Thread Richard Smith via cfe-commits
Author: rsmith Date: Fri Dec 1 13:24:36 2017 New Revision: 319584 URL: http://llvm.org/viewvc/llvm-project?rev=319584&view=rev Log: [c++17] When deducing the type of a non-type template parameter from the type of its argument, perform function-to-pointer and array-to-pointer decay on the paramete

r319601 - Move comment back to being next to the code it's a comment for.

2017-12-01 Thread Richard Smith via cfe-commits
Author: rsmith Date: Fri Dec 1 16:55:48 2017 New Revision: 319601 URL: http://llvm.org/viewvc/llvm-project?rev=319601&view=rev Log: Move comment back to being next to the code it's a comment for. Modified: cfe/trunk/lib/AST/Decl.cpp Modified: cfe/trunk/lib/AST/Decl.cpp URL: http://llvm.org

r319605 - PR35456: Track definedness of variable template specializations separately from

2017-12-01 Thread Richard Smith via cfe-commits
Author: rsmith Date: Fri Dec 1 18:48:42 2017 New Revision: 319605 URL: http://llvm.org/viewvc/llvm-project?rev=319605&view=rev Log: PR35456: Track definedness of variable template specializations separately from whether they have an initializer. We cannot distinguish between a declaration of a v

r319727 - Generalize "static data member instantiated" notification to cover variable templates too.

2017-12-04 Thread Richard Smith via cfe-commits
Author: rsmith Date: Mon Dec 4 17:31:47 2017 New Revision: 319727 URL: http://llvm.org/viewvc/llvm-project?rev=319727&view=rev Log: Generalize "static data member instantiated" notification to cover variable templates too. While here, split the "point of instantiation changed" notification out

Re: [PATCH] D40841: [analyzer] Fix a crash on C++17 AST for non-trivial construction into a trivial brace initializer.

2017-12-05 Thread Richard Smith via cfe-commits
On 5 December 2017 at 09:08, Artem Dergachev via Phabricator via cfe-commits wrote: > NoQ created this revision. > Herald added subscribers: cfe-commits, rnkovacs. > > Yet another situation where we cannot easily guess, by looking at the CFG, > the target region for C++ constructor call. > > Cons

r319817 - Give this test a triple to avoid failures on MS bots.

2017-12-05 Thread Richard Smith via cfe-commits
Author: rsmith Date: Tue Dec 5 11:39:37 2017 New Revision: 319817 URL: http://llvm.org/viewvc/llvm-project?rev=319817&view=rev Log: Give this test a triple to avoid failures on MS bots. Modified: cfe/trunk/test/Modules/var-templates.cpp Modified: cfe/trunk/test/Modules/var-templates.cpp URL

Re: r319727 - Generalize "static data member instantiated" notification to cover variable templates too.

2017-12-05 Thread Richard Smith via cfe-commits
e-checks-win/builds/6568 > > Failing Tests (3): > . . . > Clang :: Modules/var-templates.cpp > . . . > > Please have a look? > > Thanks > > Galina > > On Mon, Dec 4, 2017 at 5:31 PM, Richard Smith via cfe-commits < > cfe-commits@lists.llvm.org> wrot

r319835 - Use an even more precise triple to avoid errors on Darwin, where we don't use comdats for inline entities.

2017-12-05 Thread Richard Smith via cfe-commits
Author: rsmith Date: Tue Dec 5 13:29:36 2017 New Revision: 319835 URL: http://llvm.org/viewvc/llvm-project?rev=319835&view=rev Log: Use an even more precise triple to avoid errors on Darwin, where we don't use comdats for inline entities. Modified: cfe/trunk/test/Modules/var-templates.cpp

Re: r319727 - Generalize "static data member instantiated" notification to cover variable templates too.

2017-12-05 Thread Richard Smith via cfe-commits
Should be fixed in r319835. I'd forgotten that Darwin / MachO uses a different mechanism from COMDATs here. On 5 December 2017 at 13:27, Ahmed Bougacha via cfe-commits < cfe-commits@lists.llvm.org> wrote: > On Tue, Dec 5, 2017 at 11:40 AM, Richard Smith via cfe-commits > wrote

r319858 - P0722R2: The first parameter in an implicit call to a destroying operator

2017-12-05 Thread Richard Smith via cfe-commits
Author: rsmith Date: Tue Dec 5 15:54:25 2017 New Revision: 319858 URL: http://llvm.org/viewvc/llvm-project?rev=319858&view=rev Log: P0722R2: The first parameter in an implicit call to a destroying operator delete should be a cv-unqualified pointer to the deleted object. Modified: cfe/trunk/l

r319875 - Fix a bunch of wrong "tautological unsigned enum compare" diagnostics in C++.

2017-12-05 Thread Richard Smith via cfe-commits
Author: rsmith Date: Tue Dec 5 19:00:51 2017 New Revision: 319875 URL: http://llvm.org/viewvc/llvm-project?rev=319875&view=rev Log: Fix a bunch of wrong "tautological unsigned enum compare" diagnostics in C++. An enumeration with a fixed underlying type can have any value in its underlying type,

r319942 - Delete special-case "out-of-range" handling for bools, and just use the normal

2017-12-06 Thread Richard Smith via cfe-commits
Author: rsmith Date: Wed Dec 6 11:23:19 2017 New Revision: 319942 URL: http://llvm.org/viewvc/llvm-project?rev=319942&view=rev Log: Delete special-case "out-of-range" handling for bools, and just use the normal codepath plus the new "minimum / maximum value of type" diagnostic to get the same eff

r320122 - Unify implementation of our two different flavours of -Wtautological-compare.

2017-12-07 Thread Richard Smith via cfe-commits
Author: rsmith Date: Thu Dec 7 16:45:25 2017 New Revision: 320122 URL: http://llvm.org/viewvc/llvm-project?rev=320122&view=rev Log: Unify implementation of our two different flavours of -Wtautological-compare. In so doing, fix a handful of remaining bugs where we would report false positives or

r320124 - Fold together the in-range and out-of-range portions of -Wtautological-compare.

2017-12-07 Thread Richard Smith via cfe-commits
Author: rsmith Date: Thu Dec 7 17:00:27 2017 New Revision: 320124 URL: http://llvm.org/viewvc/llvm-project?rev=320124&view=rev Log: Fold together the in-range and out-of-range portions of -Wtautological-compare. Modified: cfe/trunk/lib/Sema/SemaChecking.cpp Modified: cfe/trunk/lib/Sema/Sema

Re: r320162 - Revert "Unify implementation of our two different flavours of -Wtautological-compare."

2017-12-08 Thread Richard Smith via cfe-commits
On 8 Dec 2017 08:54, "Hans Wennborg via cfe-commits" < cfe-commits@lists.llvm.org> wrote: Author: hans Date: Fri Dec 8 08:54:08 2017 New Revision: 320162 URL: http://llvm.org/viewvc/llvm-project?rev=320162&view=rev Log: Revert "Unify implementation of our two different flavours of -Wtautological

Re: r320162 - Revert "Unify implementation of our two different flavours of -Wtautological-compare."

2017-12-08 Thread Richard Smith via cfe-commits
I'm going to reland without the changes to bit-field handling. If we want those changes (which I think we do, based on the bugs it found in selfhost), that'll need to be done more carefully, and I don't want to get the refactoring and bugfixes here tangled up with that. On 8 December 2017 at 13:27

Re: r320162 - Revert "Unify implementation of our two different flavours of -Wtautological-compare."

2017-12-08 Thread Richard Smith via cfe-commits
for the self-host. > > On Fri, Dec 8, 2017 at 1:33 PM, Richard Smith via cfe-commits > wrote: > > I'm going to reland without the changes to bit-field handling. If we want > > those changes (which I think we do, based on the bugs it found in > selfhost), > > tha

r320211 - Unify implementation of our two different flavours of -Wtautological-compare,

2017-12-08 Thread Richard Smith via cfe-commits
Author: rsmith Date: Fri Dec 8 14:57:11 2017 New Revision: 320211 URL: http://llvm.org/viewvc/llvm-project?rev=320211&view=rev Log: Unify implementation of our two different flavours of -Wtautological-compare, and fold together into a single function. In so doing, fix a handful of remaining bugs

r320212 - Remove creation of out-of-bounds value of enumeration type (resulting in UB).

2017-12-08 Thread Richard Smith via cfe-commits
Author: rsmith Date: Fri Dec 8 15:29:59 2017 New Revision: 320212 URL: http://llvm.org/viewvc/llvm-project?rev=320212&view=rev Log: Remove creation of out-of-bounds value of enumeration type (resulting in UB). Also remove unnecessary initialization of out-parameters with this value, so that MSan

Re: r320162 - Revert "Unify implementation of our two different flavours of -Wtautological-compare."

2017-12-08 Thread Richard Smith via cfe-commits
ning is easy to fix. The >> "-1 vs enum" comparisons are more plentiful and less straightforward. >> I'm guessing it's the same for the self-host. >> >> On Fri, Dec 8, 2017 at 1:33 PM, Richard Smith via cfe-commits >> wrote: >> > I'm g

Re: r320250 - Switch to gnu++14 as the default dialect.

2017-12-09 Thread Richard Smith via cfe-commits
Thank you and everyone else who has helped to make this happen! On 9 Dec 2017 04:10, "Tim Northover via cfe-commits" < cfe-commits@lists.llvm.org> wrote: > Author: tnorthover > Date: Sat Dec 9 04:09:54 2017 > New Revision: 320250 > > URL: http://llvm.org/viewvc/llvm-project?rev=320250&view=rev >

Re: r320489 - Fix ICE when __has_unqiue_object_representations called with invalid decl

2017-12-12 Thread Richard Smith via cfe-commits
On 12 Dec 2017 16:02, "Erich Keane via cfe-commits" < cfe-commits@lists.llvm.org> wrote: Author: erichkeane Date: Tue Dec 12 08:02:06 2017 New Revision: 320489 URL: http://llvm.org/viewvc/llvm-project?rev=320489&view=rev Log: Fix ICE when __has_unqiue_object_representations called with invalid de

[clang] 740a75c - Fix assumption that Clang version number is numeric.

2022-08-29 Thread Richard Smith via cfe-commits
Author: Richard Smith Date: 2022-08-29T21:42:11-07:00 New Revision: 740a75c9d6adf8a26ebd13fc1d3460c728550624 URL: https://github.com/llvm/llvm-project/commit/740a75c9d6adf8a26ebd13fc1d3460c728550624 DIFF: https://github.com/llvm/llvm-project/commit/740a75c9d6adf8a26ebd13fc1d3460c728550624.diff

[clang] 146ae41 - Revert "[driver] Additional ignoring of module-map related flags, if modules are disabled"

2022-08-30 Thread Richard Smith via cfe-commits
Author: Richard Smith Date: 2022-08-30T18:31:53-07:00 New Revision: 146ae4138a081a9a10e4901bbec61b629331da8a URL: https://github.com/llvm/llvm-project/commit/146ae4138a081a9a10e4901bbec61b629331da8a DIFF: https://github.com/llvm/llvm-project/commit/146ae4138a081a9a10e4901bbec61b629331da8a.diff

[clang] b484256 - Add driver test for -fmodule-name and -fmodule-map-file use without -fmodules.

2022-09-02 Thread Richard Smith via cfe-commits
Author: Richard Smith Date: 2022-09-02T16:08:30-07:00 New Revision: b484256f59850e702df4d4532c5f31f478879bb9 URL: https://github.com/llvm/llvm-project/commit/b484256f59850e702df4d4532c5f31f478879bb9 DIFF: https://github.com/llvm/llvm-project/commit/b484256f59850e702df4d4532c5f31f478879bb9.diff

[clang] 220c2cb - Attempt to make AIX bot happier.

2022-09-02 Thread Richard Smith via cfe-commits
Author: Richard Smith Date: 2022-09-02T18:43:27-07:00 New Revision: 220c2cb0a88f0f1cc97ea657018abbffb8697a73 URL: https://github.com/llvm/llvm-project/commit/220c2cb0a88f0f1cc97ea657018abbffb8697a73 DIFF: https://github.com/llvm/llvm-project/commit/220c2cb0a88f0f1cc97ea657018abbffb8697a73.diff

[clang] 632e1e9 - Work around Windows buildbot failure.

2022-09-02 Thread Richard Smith via cfe-commits
Author: Richard Smith Date: 2022-09-02T19:09:15-07:00 New Revision: 632e1e9fd81d899ffa01300eb47fd417b76bbae5 URL: https://github.com/llvm/llvm-project/commit/632e1e9fd81d899ffa01300eb47fd417b76bbae5 DIFF: https://github.com/llvm/llvm-project/commit/632e1e9fd81d899ffa01300eb47fd417b76bbae5.diff

[clang] a002063 - Enforce module decl-use restrictions and private header restrictions in textual headers

2022-09-06 Thread Richard Smith via cfe-commits
Author: Richard Smith Date: 2022-09-06T17:12:57-07:00 New Revision: a002063de37c00133b93d2ce1f0ea78fc4b807ff URL: https://github.com/llvm/llvm-project/commit/a002063de37c00133b93d2ce1f0ea78fc4b807ff DIFF: https://github.com/llvm/llvm-project/commit/a002063de37c00133b93d2ce1f0ea78fc4b807ff.diff

[clang] [llvm] [clang-tools-extra] [clang] Fix false positive -Wmissing-field-initializer for anonymous unions (PR #70829)

2023-11-06 Thread Richard Smith via cfe-commits
@@ -802,9 +842,19 @@ InitListChecker::FillInEmptyInitializations(const InitializedEntity &Entity, } } } else { + InitListExpr *SForm = + ILE->isSyntacticForm() ? ILE : ILE->getSyntacticForm(); // The fields beyond ILE->getNumInits() are d

[clang] [clang-tools-extra] [llvm] [clang] Fix false positive -Wmissing-field-initializer for anonymous unions (PR #70829)

2023-11-06 Thread Richard Smith via cfe-commits
@@ -465,7 +460,8 @@ class InitListChecker { void FillInEmptyInitForField(unsigned Init, FieldDecl *Field, const InitializedEntity &ParentEntity, InitListExpr *ILE, bool &RequiresSecondPass, -

[clang] [clang-tools-extra] [llvm] [clang] Fix false positive -Wmissing-field-initializer for anonymous unions (PR #70829)

2023-11-06 Thread Richard Smith via cfe-commits
@@ -727,6 +729,44 @@ void InitListChecker::FillInEmptyInitForField(unsigned Init, FieldDecl *Field, if (hadError || VerifyOnly) { // Do nothing } else if (Init < NumInits) { zygoloid wrote: Is it OK that we don't warn on the `else` case here? Do

[clang] [clang-tools-extra] [llvm] [clang] Fix false positive -Wmissing-field-initializer for anonymous unions (PR #70829)

2023-11-06 Thread Richard Smith via cfe-commits
@@ -727,6 +729,44 @@ void InitListChecker::FillInEmptyInitForField(unsigned Init, FieldDecl *Field, if (hadError || VerifyOnly) { // Do nothing } else if (Init < NumInits) { + if (MaybeEmitMFIWarning) { +auto CheckAnonMember = [&](const FieldDecl *FD

[llvm] [clang-tools-extra] [clang] [clang] Fix false positive -Wmissing-field-initializer for anonymous unions (PR #70829)

2023-11-09 Thread Richard Smith via cfe-commits
@@ -727,6 +729,44 @@ void InitListChecker::FillInEmptyInitForField(unsigned Init, FieldDecl *Field, if (hadError || VerifyOnly) { // Do nothing } else if (Init < NumInits) { zygoloid wrote: Hmm, how does that work? If this `if` condition doesn't

[llvm] [clang-tools-extra] [clang] [clang] Fix false positive -Wmissing-field-initializer for anonymous unions (PR #70829)

2023-11-09 Thread Richard Smith via cfe-commits
@@ -727,6 +734,38 @@ void InitListChecker::FillInEmptyInitForField(unsigned Init, FieldDecl *Field, if (hadError || VerifyOnly) { // Do nothing } else if (Init < NumInits) { + if (WarnIfMissing) { +auto CheckAnonMember = [&](const FieldDecl *FD, +

<    5   6   7   8   9   10   11   12   13   14   >