Revision tags: llvmorg-21-init, llvmorg-19.1.7, llvmorg-19.1.6, llvmorg-19.1.5, llvmorg-19.1.4 |
|
#
834dfd23 |
| 18-Nov-2024 |
Kazu Hirata <kazu@google.com> |
[Parse] Remove ParseDiagnostic.h (#116496)
This patch removes clang/Parse/ParseDiagnostic.h because it just
forwards to clang/Basic/DiagnosticParse.h.
|
Revision tags: llvmorg-19.1.3, llvmorg-19.1.2 |
|
#
03229e7c |
| 10-Oct-2024 |
Younan Zhang <zyn7109@gmail.com> |
[Clang][Parser] Don't evaluate concept when its definition is invalid (#111179)
Since #103867, the nullness of the concept declaration has been turned
to represent a state in which the concept defi
[Clang][Parser] Don't evaluate concept when its definition is invalid (#111179)
Since #103867, the nullness of the concept declaration has been turned
to represent a state in which the concept definition is being parsed and
used for self-reference checking.
However, PR missed a case where such a definition could be invalid, and
we shall inhibit making it into evaluation.
Fixes https://github.com/llvm/llvm-project/issues/109780
show more ...
|
Revision tags: llvmorg-19.1.1, llvmorg-19.1.0 |
|
#
030e4d0c |
| 04-Sep-2024 |
cor3ntin <corentinjabot@gmail.com> |
[Clang] Treat default template argument as constant expressions (#107073)
We only check that a default argument is a converted constant expression
when using the default argument.
However, when
[Clang] Treat default template argument as constant expressions (#107073)
We only check that a default argument is a converted constant expression
when using the default argument.
However, when parsing a default argument, we need to make sure to parse
it as a constant expression such as not ODR-use variables. (otherwise,
we would try to capture default template arguments of generic lambdas)
Fixes #107048
show more ...
|
Revision tags: llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3 |
|
#
0dedd6fe |
| 14-Aug-2024 |
cor3ntin <corentinjabot@gmail.com> |
[Clang] Adjust concept definition locus (#103867)
Per [basic.scope], the locus of a concept is immediately after the
introduction of its name.
This let us provide better diagnostics for attempt
[Clang] Adjust concept definition locus (#103867)
Per [basic.scope], the locus of a concept is immediately after the
introduction of its name.
This let us provide better diagnostics for attempt to define recursive
concepts.
Note that recursive concepts are not supported per
https://eel.is/c++draft/basic#scope.pdecl-note-3, but there is no
normative wording for that restriction. This is a known defect
introduced by
[p1787r6](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1787r6.html).
Fixes #55875
show more ...
|
Revision tags: llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1, llvmorg-20-init |
|
#
dba2e66e |
| 16-Jul-2024 |
Mariya Podchishchaeva <mariya.podchishchaeva@intel.com> |
[clang] Inject tokens containing #embed back into token stream (#97274)
Instead of playing "whack a mole" with places where #embed should be
expanded as comma-separated list, just inject each byte
[clang] Inject tokens containing #embed back into token stream (#97274)
Instead of playing "whack a mole" with places where #embed should be
expanded as comma-separated list, just inject each byte as a token back
into the stream, separated by commas.
show more ...
|
#
41c6e437 |
| 20-Jun-2024 |
Mariya Podchishchaeva <mariya.podchishchaeva@intel.com> |
Reland [clang][Sema, Lex, Parse] Preprocessor embed in C and C++ (#95802)
This commit implements the entirety of the now-accepted [N3017
-Preprocessor
Embed](https://www.open-std.org/jtc1/sc22/wg1
Reland [clang][Sema, Lex, Parse] Preprocessor embed in C and C++ (#95802)
This commit implements the entirety of the now-accepted [N3017
-Preprocessor
Embed](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3017.htm) and
its sister C++ paper [p1967](https://wg21.link/p1967). It implements
everything in the specification, and includes an implementation that
drastically improves the time it takes to embed data in specific
scenarios (the initialization of character type arrays). The mechanisms
used to do this are used under the "as-if" rule, and in general when the
system cannot detect it is initializing an array object in a variable
declaration, will generate EmbedExpr AST node which will be expanded by
AST consumers (CodeGen or constant expression evaluators) or expand
embed directive as a comma expression.
This reverts commit
https://github.com/llvm/llvm-project/commit/682d461d5a231cee54d65910e6341769419a67d7.
---------
Co-authored-by: The Phantom Derpstorm <phdofthehouse@gmail.com>
Co-authored-by: Aaron Ballman <aaron@aaronballman.com>
Co-authored-by: cor3ntin <corentinjabot@gmail.com>
Co-authored-by: H. Vetinari <h.vetinari@gmx.com>
show more ...
|
Revision tags: llvmorg-18.1.8 |
|
#
682d461d |
| 12-Jun-2024 |
Vitaly Buka <vitalybuka@google.com> |
Revert "✨ [Sema, Lex, Parse] Preprocessor embed in C and C++ (and Obj-C and Obj-C++ by-proxy)" (#95299)
Reverts llvm/llvm-project#68620
Introduce or expose a memory leak and UB, see llvm/llvm-pro
Revert "✨ [Sema, Lex, Parse] Preprocessor embed in C and C++ (and Obj-C and Obj-C++ by-proxy)" (#95299)
Reverts llvm/llvm-project#68620
Introduce or expose a memory leak and UB, see llvm/llvm-project#68620
show more ...
|
#
5989450e |
| 12-Jun-2024 |
The Phantom Derpstorm <phdofthehouse@gmail.com> |
[clang][Sema, Lex, Parse] Preprocessor embed in C and C++ (and Obj-C and Obj-C++ by-proxy) (#68620)
This commit implements the entirety of the now-accepted [N3017 -
Preprocessor
Embed](https://www
[clang][Sema, Lex, Parse] Preprocessor embed in C and C++ (and Obj-C and Obj-C++ by-proxy) (#68620)
This commit implements the entirety of the now-accepted [N3017 -
Preprocessor
Embed](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3017.htm) and
its sister C++ paper [p1967](https://wg21.link/p1967). It implements
everything in the specification, and includes an implementation that
drastically improves the time it takes to embed data in specific
scenarios (the initialization of character type arrays). The mechanisms
used to do this are used under the "as-if" rule, and in general when the
system cannot detect it is initializing an array object in a variable
declaration, will generate EmbedExpr AST node which will be expanded
by AST consumers (CodeGen or constant expression evaluators) or
expand embed directive as a comma expression.
---------
Co-authored-by: Aaron Ballman <aaron@aaronballman.com>
Co-authored-by: cor3ntin <corentinjabot@gmail.com>
Co-authored-by: H. Vetinari <h.vetinari@gmx.com>
Co-authored-by: Podchishchaeva, Mariya <mariya.podchishchaeva@intel.com>
show more ...
|
Revision tags: llvmorg-18.1.7, llvmorg-18.1.6 |
|
#
874f511a |
| 17-May-2024 |
Vlad Serebrennikov <serebrennikov.vladislav@gmail.com> |
[clang] Introduce `SemaCodeCompletion` (#92311)
This patch continues previous efforts to split `Sema` up, this time
covering code completion.
Context can be found in #84184.
Dropping `Code` prefi
[clang] Introduce `SemaCodeCompletion` (#92311)
This patch continues previous efforts to split `Sema` up, this time
covering code completion.
Context can be found in #84184.
Dropping `Code` prefix from function names in `SemaCodeCompletion` would
make sense, but I think this PR has enough changes already.
As usual, formatting changes are done as a separate commit. Hopefully
this helps with the review.
show more ...
|
#
d3d5a300 |
| 17-May-2024 |
Vlad Serebrennikov <serebrennikov.vladislav@gmail.com> |
[clang][NFC] Remove `const_cast` from `ParseClassSpecifier`
|
#
a68d20e9 |
| 17-May-2024 |
Vlad Serebrennikov <serebrennikov.vladislav@gmail.com> |
[clang] Implement CWG2428 "Deprecating a concept" (#92295)
This patch allows attributes to be attached to C++20 concepts,
implementing
[CWG2428](https://cplusplus.github.io/CWG/issues/2428.html).
|
Revision tags: llvmorg-18.1.5 |
|
#
8ab3caf4 |
| 23-Apr-2024 |
Younan Zhang <zyn7109@gmail.com> |
[Clang][Parser] Don't always destroy template annotations at the end of a declaration (#89494)
Since
[6163aa9](https://github.com/llvm/llvm-project/commit/6163aa96799cbad7f2f58e02c5bebee9647056a5#d
[Clang][Parser] Don't always destroy template annotations at the end of a declaration (#89494)
Since
[6163aa9](https://github.com/llvm/llvm-project/commit/6163aa96799cbad7f2f58e02c5bebee9647056a5#diff-3a7ef0bff7d2b73b4100de636f09ea68b72eda191b39c8091a6a1765d917c1a2),
we have introduced an optimization that almost always destroys
TemplateIdAnnotations at the end of a function declaration. This doesn't
always work properly: a lambda within a default template argument could
also result in such deallocation and hence a use-after-free bug while
building a type constraint on the template parameter.
This patch adds another flag to the parser to tell apart cases when we
shouldn't do such cleanups eagerly. A bit complicated as it is, this retains
the optimization on a highly templated function with lots of generic lambdas.
Note the test doesn't always trigger a conspicuous bug/crash even with a
debug build. But a sanitizer build can detect them, I believe.
Fixes https://github.com/llvm/llvm-project/issues/67235
Fixes https://github.com/llvm/llvm-project/issues/89127
show more ...
|
Revision tags: llvmorg-18.1.4 |
|
#
4e6d18f4 |
| 11-Apr-2024 |
Krystian Stasiowski <sdkrystian@gmail.com> |
[Clang][AST] Track whether template template parameters used the 'typename' keyword (#88139)
This patch adds a `Typename` bit-field to `TemplateTemplateParmDecl`
which stores whether the template t
[Clang][AST] Track whether template template parameters used the 'typename' keyword (#88139)
This patch adds a `Typename` bit-field to `TemplateTemplateParmDecl`
which stores whether the template template parameter was declared with
the `typename` keyword.
show more ...
|
#
fca51911 |
| 11-Apr-2024 |
Bill Wendling <5993918+bwendling@users.noreply.github.com> |
[NFC][Clang] Improve const correctness for IdentifierInfo (#79365)
The IdentifierInfo isn't typically modified. Use 'const' wherever
possible.
|
Revision tags: llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2 |
|
#
c5f46191 |
| 01-Feb-2024 |
Krystian Stasiowski <sdkrystian@gmail.com> |
[Clang][Parse] Diagnose member template declarations with multiple declarators (#78243)
According to [temp.pre] p5:
> In a template-declaration, explicit specialization, or explicit instantiation t
[Clang][Parse] Diagnose member template declarations with multiple declarators (#78243)
According to [temp.pre] p5:
> In a template-declaration, explicit specialization, or explicit instantiation the init-declarator-list in the declaration shall contain at most one declarator.
A member-declaration that is a template-declaration or explicit-specialization contains a declaration, even though it declares a member. This means it _will_ contain an init-declarator-list (not a member-declarator-list), so [temp.pre] p5 applies.
This diagnoses declarations such as:
```
struct A
{
template<typename T>
static const int x = 0, f(); // error: a template declaration can only declare a single entity
template<typename T>
static const int g(), y = 0; // error: a template declaration can only declare a single entity
};
```
The diagnostic messages are the same as those of the equivalent namespace scope declarations.
Note: since we currently do not diagnose declarations with multiple abbreviated function template declarators at namespace scope e.g., `void f(auto), g(auto);`, so this patch does not add diagnostics for the equivalent member declarations.
This patch also refactors `ParseSingleDeclarationAfterTemplate` (now named `ParseDeclarationAfterTemplate`) to call `ParseDeclGroup` and return the resultant `DeclGroup`.
show more ...
|
Revision tags: llvmorg-18.1.0-rc1, llvmorg-19-init |
|
#
f40d2515 |
| 01-Dec-2023 |
cor3ntin <corentinjabot@gmail.com> |
[Clang] Implement P2308R1 - Template Parameter Initialization. (#73103)
https://wiki.edg.com/pub/Wg21kona2023/StrawPolls/p2308r1.html
This implements P2308R1 as a DR and resolves CWG2459, CWG2450
[Clang] Implement P2308R1 - Template Parameter Initialization. (#73103)
https://wiki.edg.com/pub/Wg21kona2023/StrawPolls/p2308r1.html
This implements P2308R1 as a DR and resolves CWG2459, CWG2450 and
CWG2049.
Fixes #73666
Fixes #58434
Fixes #41227
Fixes #49978
Fixes #36296
show more ...
|
Revision tags: llvmorg-17.0.6, llvmorg-17.0.5, llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init |
|
#
a8bef886 |
| 22-Jun-2023 |
Corentin Jabot <corentinjabot@gmail.com> |
[Clang] Implement P2169 A nice placeholder with no name
This is a C++ feature that allows the use of `_` to declare multiple variable of that name in the same scope; these variables can then not be
[Clang] Implement P2169 A nice placeholder with no name
This is a C++ feature that allows the use of `_` to declare multiple variable of that name in the same scope; these variables can then not be referred to.
In addition, while P2169 does not extend to parameter declarations, we stop warning on unused parameters of that name, for consistency.
The feature is backported to all C++ language modes.
Reviewed By: #clang-language-wg, aaron.ballman
Differential Revision: https://reviews.llvm.org/D153536
show more ...
|
#
cc006acd |
| 17-Jul-2023 |
Serge Pavlov <sepavloff@gmail.com> |
[clang] Fix delayed template parsing
Commit 98390ccb80569e8fbb20e6c996b4b8cff87fbec6 fixed late template instantiation by clearing FP pragma stack before instantiation. This solution was based on th
[clang] Fix delayed template parsing
Commit 98390ccb80569e8fbb20e6c996b4b8cff87fbec6 fixed late template instantiation by clearing FP pragma stack before instantiation. This solution was based on the assumptions:
- FP pragma stack is not used anymore and it is safe to clear it, - Default FP options are determined by command line options.
Both the assumptions are wrong. When compilation produces precompiled header file, state of the stack is serialized and then restored when the precompiled header is used. Delayed template parsing occurs at the end of translation unit but before serialization, so clearing FP pragma stack effects serialized representation. When the precompiled file is loaded, some conditions can be broken and clang crashed, it was described in https://github.com/llvm/llvm-project/issues/63704. The crash was observed only in few cases, on most buildbots it was absent.
The violation of expected conditions was caused by violation of the second assumption. FPEvalMethod can be modified by target, so it is not possible to deduce it from LangOptions only. So default FP state read from precompiled header was different from the state in the initialized Sema, and this was the crash reason.
Only two targets do such modification of default FP options, these are i386 and AIX. so the problem was hard to reproduce.
Delayed template parsing should occur with empty pragma stack, so it must be cleared before the instantiation, but the stack now is saved and restored after the instantiation is done.
This change should fix https://github.com/llvm/llvm-project/issues/63704.
Differential Revision: https://reviews.llvm.org/D155380
show more ...
|
#
2e903709 |
| 05-Jul-2023 |
Serge Pavlov <sepavloff@gmail.com> |
[Clang] Reset FP options before function instantiations
This is recommit of 98390ccb80569e8fbb20e6c996b4b8cff87fbec6, reverted in 82a3969d710f5fb7a2ee4c9afadb648653923fef, because it caused https://
[Clang] Reset FP options before function instantiations
This is recommit of 98390ccb80569e8fbb20e6c996b4b8cff87fbec6, reverted in 82a3969d710f5fb7a2ee4c9afadb648653923fef, because it caused https://github.com/llvm/llvm-project/issues/63542. Although the problem described in the issue is independent of the reverted patch, fail of PCH/late-parsed-instantiations.cpp indeed obseved on PowerPC and is likely to be caused by wrong serialization of `LateParsedTemplate` objects. In this patch the serialization is fixed.
Original commit message is below.
Previously function template instantiations occurred with FP options that were in effect at the end of translation unit. It was a problem for late template parsing as these FP options were used as attributes of AST nodes and may result in crash. To fix it FP options are set to the state of the point of template definition.
Differential Revision: https://reviews.llvm.org/D143241
show more ...
|
#
82a3969d |
| 28-Jun-2023 |
Serge Pavlov <sepavloff@gmail.com> |
Revert "[Clang] Reset FP options before function instantiations"
This reverts commit 98390ccb80569e8fbb20e6c996b4b8cff87fbec6. It caused issue #63542.
|
#
98390ccb |
| 28-Jun-2023 |
Serge Pavlov <sepavloff@gmail.com> |
[Clang] Reset FP options before function instantiations
Previously function template instantiations occurred with FP options that were in effect at the end of translation unit. It was a problem for
[Clang] Reset FP options before function instantiations
Previously function template instantiations occurred with FP options that were in effect at the end of translation unit. It was a problem for late template parsing as these FP options were used as attributes of AST nodes and may result in crash. To fix it FP options are set to the state of the point of template definition.
Differential Revision: https://reviews.llvm.org/D143241
show more ...
|
Revision tags: llvmorg-16.0.6, llvmorg-16.0.5 |
|
#
cecd8471 |
| 01-Jun-2023 |
Elizabeth Andrews <elizabeth.andrews@intel.com> |
[Clang][Parser] Accept GNU attributes preceding C++ attributes on templates
Clang was rejecting valid code where GNU style attributes preceded C++ style attributes in template declarations as follow
[Clang][Parser] Accept GNU attributes preceding C++ attributes on templates
Clang was rejecting valid code where GNU style attributes preceded C++ style attributes in template declarations as follows:
template<int a> __attribute__((deprecated("oh no!"))) [[deprecated("oh no!")]] void foo();
This PR fixes the bug.
Differential Revision: https://reviews.llvm.org/D151837
show more ...
|
#
75cd8cdb |
| 24-May-2023 |
Corentin Jabot <corentinjabot@gmail.com> |
[Clang] Correctly handle generic lambda used as default template argument.
Adjust the template pparameter depth when parsing default template arguments as they may introduce generic lambda whose par
[Clang] Correctly handle generic lambda used as default template argument.
Adjust the template pparameter depth when parsing default template arguments as they may introduce generic lambda whose parameters are not substituted at the same depth.
Fixes #62611
Reviewed By: erichkeane, #clang-language-wg
Differential Revision: https://reviews.llvm.org/D151342
show more ...
|
Revision tags: llvmorg-16.0.4 |
|
#
b321738f |
| 15-May-2023 |
Alejandro Álvarez Ayllón <alejandro.alvarez@sonarsource.com> |
[clang][parser] Fix namespace dropping after malformed declarations
* After a malformed top-level declaration * After a malformed templated class method declaration
In both cases, when there is a m
[clang][parser] Fix namespace dropping after malformed declarations
* After a malformed top-level declaration * After a malformed templated class method declaration
In both cases, when there is a malformed declaration, any following namespace is dropped from the AST. This can trigger a cascade of confusing diagnostics that may hide the original error. An example: ``` // Start #include "SomeFile.h" template <class T> void Foo<T>::Bar(void* aRawPtr) { (void)(aRawPtr); } // End #include "SomeFile.h"
int main() {} ``` We get the original error, plus 19 others from the standard library. With this patch, we only get the original error.
clangd can also benefit from this patch, as namespaces following the malformed declaration is now preserved. i.e. ```
MACRO_FROM_MISSING_INCLUDE("X")
namespace my_namespace { //... } ``` Before this patch, my_namespace is not visible for auto-completion.
Differential Revision: https://reviews.llvm.org/D150258
show more ...
|
#
6d688055 |
| 04-May-2023 |
David Stone <davidfromonline@gmail.com> |
[clang][Sema][NFC] Move `EnterExpressionEvaluationContext` to its own file
Sema.h is huge. This makes a small reduction to it by moving EnterExpressionEvaluationContext into a new header, since it i
[clang][Sema][NFC] Move `EnterExpressionEvaluationContext` to its own file
Sema.h is huge. This makes a small reduction to it by moving EnterExpressionEvaluationContext into a new header, since it is an independent component.
Differential Revision: https://reviews.llvm.org/D149796
show more ...
|