| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
| |
annotates an invalid template-id
TryAnnotateTypeConstraint could annotate a template-id which doesn't end up being a type-constraint,
in which case control flow would incorrectly flow into ParseImplicitInt.
Reenter the loop in this case.
Enable relevant tests for C++20. This required disabling typo-correction during TryAnnotateTypeConstraint
and changing a test case which is broken due to a separate bug (will be reported and handled separately).
(cherry picked from commit 19fccc52ff2c1da1f93d9317c34769bd9bab8ac8)
|
|
|
|
|
|
|
|
|
| |
annotates an invalid template-id"
We're not planning more release candidates for 10.0.0 at the moment, so
reverting for now.
This reverts commit 135744ce689569e7c64033bb5812572d3000239b.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
annotates an invalid template-id
TryAnnotateTypeConstraint could annotate a template-id which doesn't end up being a type-constraint,
in which case control flow would incorrectly flow into ParseImplicitInt.
Reenter the loop in this case.
Enable relevant tests for C++20. This required disabling typo-correction during TryAnnotateTypeConstraint
and changing a test case which is broken due to a separate bug (will be reported and handled separately).
(cherry picked from commit 19fccc52ff2c1da1f93d9317c34769bd9bab8ac8)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
a dependent context.
This matches the GCC behavior.
We track the enclosing template depth when determining whether a
statement expression is within a dependent context; there doesn't appear
to be any other reliable way to determine this.
We previously assumed they were neither value- nor
instantiation-dependent under any circumstances, which would lead to
crashes and other misbehavior.
(cherry picked from commit 5c845c1c50ac89a6f12557d1571678f3d1432478)
|
|
|
|
|
|
|
|
|
| |
appear in"
This turned out to cause problems, and was reverted on master together
with its follow-up change in 66addf8e803618758457e4d578c5084e322ca448.
This reverts commit 3a843031a5ad83a00d2603f623881cb2b2bf719d.
|
|
|
|
|
|
|
|
|
|
| |
dependent contexts.
We previously assumed they were neither value- nor
instantiation-dependent under any circumstances, which would lead to
crashes and other misbehavior.
(cherry picked from commit bdad0a1b79273733df9acc1be4e992fa5d70ec56)
|
|
|
|
|
|
|
|
|
|
| |
If an error had occurred when annotating a scope spec during the tentative parse
for a type-requirement, we would not revert nor commit the tentative parse, triggerring
an assertion failure.
Commit the TPA in this case and then do error recovery.
(cherry picked from commit 271e495399170d69627c1acd591c9298cb0b5b4b)
|
|
|
|
|
|
|
|
|
| |
isDeclarationSpecifiers did not handle some cases of placeholder-type-specifiers with
type-constraints, causing parsing bugs in abbreviated constructor templates.
Add comprehensive handling of type-constraints to isDeclarationSpecifier.
(cherry picked from commit b7ce85a130789d23c69156f4b899962458d1f05d)
|
|
|
|
|
|
|
| |
Attributes are permitted on friend definitions, but we only checked for
a proper function body, not for the =default / =delete cases.
(cherry picked from commit 5ae6554a1dcd2e39346030c06d364492901c9e8d)
|
|
|
|
|
|
|
|
|
|
|
| |
tests for scope specifiers in type-constraints
The code for parsing of type-constraints in compound-requirements was not adapted for the new TryAnnotateTypeConstraint which
caused compound-requirements with scope specifiers to ignore them.
Also add regression tests for scope specifiers in type-constraints in more contexts.
(cherry picked from commit 5043962dd3150c6ac72b75174b9460a510d1b5c3)
|
|
|
|
|
|
|
|
|
| |
As per P1980R0, constraint expressions are unevaluated operands, and their constituent atomic
constraints only become constant evaluated during satisfaction checking.
Change the evaluation context during parsing and instantiation of constraints to unevaluated.
(cherry picked from commit 73eaf62463b4a29adf4194685af12d1a5d172987)
|
|
|
|
|
|
|
|
|
| |
Now with concepts support merged and mostly complete, we do not need -fconcepts-ts
(which was also misleading as we were not implementing the TS) and can enable
concepts features under C++2a. A warning will be generated if users still attempt
to use -fconcepts-ts.
(cherry picked from commit 67c608a9695496cfc9d3fdf9d0b12b554ac6b4df)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch implements P1141R2 "Yet another approach for constrained declarations".
General strategy for this patch was:
- Expand AutoType to include optional type-constraint, reflecting the wording and easing the integration of constraints.
- Replace autos in parameter type specifiers with invented parameters in GetTypeSpecTypeForDeclarator, using the same logic
previously used for generic lambdas, now unified with abbreviated templates, by:
- Tracking the template parameter lists in the Declarator object
- Tracking the template parameter depth before parsing function declarators (at which point we can match template
parameters against scope specifiers to know if we have an explicit template parameter list to append invented parameters
to or not).
- When encountering an AutoType in a parameter context we check a stack of InventedTemplateParameterInfo structures that
contain the info required to create and accumulate invented template parameters (fields that were already present in
LambdaScopeInfo, which now inherits from this class and is looked up when an auto is encountered in a lambda context).
Resubmit after fixing MSAN failures caused by incomplete initialization of AutoTypeLocs in TypeSpecLocFiller.
Differential Revision: https://reviews.llvm.org/D65042
(cherry picked from commit b481f028144ca91c15d1db3649ce14f174259e7e)
|
|
|
|
|
|
|
| |
TryAnnotateTypeConstraint would not put the scope specifier back into the token stream when faced
with a non-concept name after a scope specifier.
(cherry picked from commit de51559fa68049da73b696a4e89468154b12852a)
|
|
|
|
|
|
|
|
| |
D50360 caused some platforms to not compile due to a parameter with the name of a type.
Rename the parameter.
(cherry picked from commit e68c1e00eba4ae64d38e62eebebd581e3d3d6bd4)
|
|
|
|
|
|
|
|
|
|
| |
Implement support for C++2a requires-expressions.
Re-commit after compilation failure on some platforms due to alignment issues with PointerIntPair.
Differential Revision: https://reviews.llvm.org/D50360
(cherry picked from commit a0f50d731639350c7a79f140f026c27a18215531)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A TemplateIdAnnotation represents only a template-id, not a
nested-name-specifier plus a template-id. Don't make a redundant copy of
the CXXScopeSpec and store it on the template-id annotation.
This slightly improves error recovery by more properly handling the case
where we would form an invalid CXXScopeSpec while parsing a typename
specifier, instead of accidentally putting the token stream into a
broken "annot_template_id with a scope specifier, but with no preceding
annot_cxxscope token" state.
(cherry picked from commit a42fd84cff265b7e9faa3fe42885ee171393e4db)
|
|
|
|
|
|
|
|
| |
This needs somewhat careful disambiguation, as C++2a explicit(bool) is a
breaking change. We only enable it in cases where the source construct
could not possibly be anything else.
(cherry picked from commit 45d70806f4386adfb62b0d75949a8aad58e0576f)
|
|
|
|
|
|
|
| |
Add support for type-constraints in template type parameters.
Also add support for template type parameters as pack expansions (where the type constraint can now contain an unexpanded parameter pack).
Differential Revision: https://reviews.llvm.org/D44352
|
| |
|
|
|
|
|
|
| |
Function trailing requires clauses now parsed, supported in overload resolution and when calling, referencing and taking the address of functions or function templates.
Differential Revision: https://reviews.llvm.org/D43357
|
|
|
|
|
| |
Use ParseExpression() instead of ParseAssignmentExpression() to allow
commas in combiner expressions.
|
|
|
|
|
|
|
|
| |
An empty string literal in an asm label does not make a whole lot of sense. GCC
does not diagnose such a construct, but it also generates code that cannot be
assembled by gas should two symbols have an empty asm label within the same TU.
This does not affect an asm statement with an empty string literal, which is
still a useful construct.
|
|
|
|
|
|
|
|
|
| |
If standalone OpenMP declaration pragma, like declare mapper or declare
reduction, is declared in the class context, it may reference a member
(data or function) in its internal expressions/statements. So, the
parsing of such pragmas must be dalayed just like the parsing of the
member initializers/definitions before the completion of the class
declaration.
|
|
|
|
|
|
| |
Reviewed By: craig.topper, skan
Differential Revision: https://reviews.llvm.org/D72247
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: aaron.ballman, xbolva00
Reviewed By: aaron.ballman
Subscribers: nickdesaulniers, nathanchance
Differential Revision: https://reviews.llvm.org/D72202
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
this allow much better support of codebases like the linux kernel that mix tabs and spaces.
-ftabstop=//Width// allow specifying how large tabs are considered to be.
Reviewers: xbolva00, aaron.ballman, rsmith
Reviewed By: aaron.ballman
Subscribers: mstorsjo, cfe-commits, jyknight, riccibruno, rsmith, nathanchance
Tags: #clang
Differential Revision: https://reviews.llvm.org/D71037
|
|
|
|
|
|
| |
init.
Braced initializers were not accepted after the last fix in the initialier.Restored previous functionality.
|
|
|
|
|
|
|
|
|
| |
This reverts commit b47b35ff51b355a446483777155290541ab64fae.
This caused failed asserts (Assertion `FIDAndOffset.second >
ColNo && "Column number smaller than file offset?"' failed.)
on a source file with a single line containing
"int main (void) { for( int i = 0; i < 9; i++ ); return 0; }".
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
this allow much better support of codebases like the linux kernel that mix tabs and spaces.
-ftabstop=//Width// allow specifying how large tabs are considered to be.
Reviewers: xbolva00, aaron.ballman, rsmith
Reviewed By: aaron.ballman
Subscribers: jyknight, riccibruno, rsmith, nathanchance
Differential Revision: https://reviews.llvm.org/D71037
|
|
|
|
|
| |
Added initialization of the extra modifier to silence sanitizer. Added
extra checks to avoid such trouble in future.
|
|
|
|
| |
Added parsing/sema checks for conditional lastprivates.
|
|
|
|
|
| |
Add basic support for parsing/sema analysis of the nontemporal clause in
simd-based directives.
|
|
|
|
|
|
| |
When parsing the code with OpenMP and the function's body must be
skipped, need to skip also OpenMP annotation tokens. Otherwise the
counters for braces/parens are unbalanced and parsing fails.
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: aaron.ballman
Reviewed By: aaron.ballman
Subscribers: xbolva00
Differential Revision: https://reviews.llvm.org/D71083
|
|
|
|
|
|
|
| |
This simplifies code where no extra details are required
Also don't write out detail when it is empty.
Differential Revision: https://reviews.llvm.org/D71347
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Null type pointers could be dereferenced in some cases.
Reviewers: kadircet, sammccall
Reviewed By: sammccall
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D71329
|
|
|
|
|
|
|
|
|
| |
variant directive.
If the function is used only in declare variant directive as a variant
function, it should not be marked as used to prevent emission of the
target-specific functions. Build the reference in the unevaluated
context.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
The new OpenMPConstants.h is a location for all OpenMP related constants
(and helpers) to live.
This patch moves the directives there (the enum OpenMPDirectiveKind) and
rewires Clang to use the new location.
Initially part of D69785.
Reviewers: kiranchandramohan, ABataev, RaviNarayanaswamy, gtbercea, grokos, sdmitriev, JonChesterfield, hfinkel, fghanim
Subscribers: jholewinski, ppenzin, penzn, llvm-commits, cfe-commits, jfb, guansong, bollu, hiraditya, mgorny
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D69853
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Instead, emit a diagnostic and return an empty ASM node, as we do if the target
is missing.
Filter this diagnostic out in clangd, where it's not meaningful.
Fixes https://github.com/clangd/clangd/issues/222
Reviewers: kadircet
Subscribers: mgorny, ilya-biryukov, jkorous, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D71189
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: ABataev, jdoerfert
Reviewed By: ABataev
Subscribers: rnk, jholewinski, guansong, arphaman, jfb, cfe-commits, sandoval, dreachem
Tags: #clang
Differential Revision: https://reviews.llvm.org/D70726
|
|
|
|
|
|
| |
This reverts commit 713dab21e27c987b9114547ce7136bac2e775de9.
Tests do not pass on Windows.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: ABataev, jdoerfert
Reviewed By: ABataev
Subscribers: jholewinski, guansong, arphaman, jfb, cfe-commits, sandoval, dreachem
Tags: #clang
Differential Revision: https://reviews.llvm.org/D70726
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The addr space qualifier can be added optionally for lambdas after
the attributes. They will alter the default addr space of lambda
call operator that is in generic address space by default for OpenCL.
Syntax:
[ captures ] ( params ) specifiers exception attr opencl_addrspace
-> ret { body }
Example:
[&] (int i) mutable __global { ... };
On the call into lambda a compatibility check will be performed to
determine whether address space of lambda object and its call operator
are compatible. This will follow regular addr space conversion rules
and there will be no difference to how addr spaces work in method
qualifiers.
Tags: #clang
Differential Revision: https://reviews.llvm.org/D70242
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
is finished (PR40006)
This was already the intention of DelayedDllExportClasses, but code such as
this would break it:
template<typename> struct Tmpl {};
struct Outer {
struct Inner {
__declspec(dllexport) Inner() = default;
unsigned int x = 0;
};
Tmpl<Inner> y;
};
ActOnFinishCXXNonNestedClass() would get called when the instantiation of
Templ<Inner> is finished, even though the compiler is still not finished with
Outer, causing the compile fail.
This hooks into Sema::{Push,Pop}ParsingClass() to avoid calling
ActOnFinishCXXNonNestedClass() for template instantiations while a class is
being parsed.
Differential revision: https://reviews.llvm.org/D70905
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Add a warning for misleading indentation similar to GCC's -Wmisleading-indentation
Reviewers: aaron.ballman, xbolva00
Reviewed By: aaron.ballman, xbolva00
Subscribers: tstellar, cfe-commits, arphaman, Ka-Ka, thakis
Tags: #clang
Differential Revision: https://reviews.llvm.org/D70638
|
| |
|
|
|
|
|
|
| |
This reverts commit 7b86188b50bf6e537fe98b326f258fbd23108b83.
This commit introduced bot falures for multi-stage bots with -Werror.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Add a warning for misleading indentation similar to GCC's -Wmisleading-indentation
Reviewers: aaron.ballman, xbolva00
Reviewed By: aaron.ballman, xbolva00
Subscribers: arphaman, Ka-Ka, thakis
Differential Revision: https://reviews.llvm.org/D70638
|
|
|
|
|
| |
This removes one of the two uses of Attr.h in DeclCXX.h, reducing the
need to include Attr.h as widely. LangOptions is already very popular.
|