| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
This reverts commit 22e3f587fd1ff97185014cb1ba723579ed2150d3.
Breaks check-clang on arm, see https://reviews.llvm.org/D144654#4349954
Also reverts follow-up "[AArch64] Don't redefine _LP64 and __LP64__"
This reverts commit e55d52cd34fb7a6a6617639d147b9d0abaceeeab.
|
|
|
|
|
|
|
| |
Add cplusplus20, cplusplus23, and cplusplus26 (but don't document
the latter, following the current policy).
Differential Revision: https://reviews.llvm.org/D150773
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently we warn when MI->isBuiltinMacro, but this is only true for
builtin macros that require processing when expanding. Checking
SourceMgr.isWrittenInBuiltinFile in addition to this will mean that
we catch all builtin macros, though we shouldn't warn on feature test
macros.
As part of doing this I've also moved the handling of undefining from
CheckMacroName to HandleUndefDirective, as it doesn't really make
sense to handle undefining in CheckMacroName but defining in
HandleDefineDirective. It would be nice to instead handle both in
CheckMacroName, but that isn't possible as the handling of defines
requires looking at what the name is being defined to.
Differential Revision: https://reviews.llvm.org/D144654
|
|
|
|
|
|
|
| |
We were documenting that this was about recursive calls when it's
actually about arbitrary calls.
e.g., https://godbolt.org/z/en8sYd77E
|
|
|
|
|
|
|
| |
This reverts commit e2917311f026cc445fa8aeefa0457b0c7a60824a.
This caused some problems with lldb testing the diagnostic output:
https://lab.llvm.org/buildbot/#/builders/68/builds/52754
|
|
|
|
|
| |
Breakage:
https://lab.llvm.org/buildbot/#/builders/92/builds/44222
|
|
|
|
|
|
|
| |
Show line numbers to the left of diagnostic code snippets and increase
the numbers of lines shown from 1 to 16.
Differential Revision: https://reviews.llvm.org/D147875
|
|
|
|
|
|
|
|
|
| |
subobject in constexpr variables
This patch improves the diagnostic on uninitialized subobjects in constexpr variables by modifying the diagnostic message to display the subobject's name instead of its type.
Fixes https://github.com/llvm/llvm-project/issues/58601
Differential Revision: https://reviews.llvm.org/D146358
|
|
|
|
|
|
| |
This reverts commit ef47318ec3615e83c328b07341046dfb9d869414.
This patch breaks valid code https://reviews.llvm.org/D149276#4345620
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Allow auto(x) to appear in a parenthesis
expression.
The pattern (auto( can appear as part of a declarator,
so the parser is modified to avoid the ambiguity,
in a way consistent with the proposed resolution to CWG1223.
Reviewed By: aaron.ballman, #clang-language-wg
Differential Revision: https://reviews.llvm.org/D149276
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
```
module x
#( //
parameter x)
( //
input y);
endmodule
```
After:
```
module x
#(//
parameter x)
(//
input y);
endmodule
```
If the first line in a port or parameter list is not a comment, the
following lines will be aligned to the first line as intended:
```
module x
#(parameter x1,
parameter x2)
(input y,
input y2);
endmodule
```
Previously, the indentation would be changed to an extra continuation
indentation relative to the start of the parenthesis or the hash if
the first token inside the parentheses was a comment. It is a feature
introduced in ddaa9be97839. The feature enabled one to insert a `//`
comment right after an opening parentheses to put the function
arguments on a new line with a small indentation regardless of how
long the function name is, like this:
```
someFunction(anotherFunction( // Force break.
parameter));
```
People are unlikely to use this feature in a Verilog port list because
the formatter already puts the port list on its own lines. A comment
at the start of a port list is probably a comment for the port on the
next line.
We also removed the space before the comment so that its indentation
would be same as that for a line comment anywhere else in the port
list.
Reviewed By: HazardyKnusperkeks
Differential Revision: https://reviews.llvm.org/D149562
|
|
|
|
|
|
|
|
| |
Now that we've updated to C++23, we need to add C++26/C++2c command line
flags, as discussed in
https://discourse.llvm.org/t/rfc-lets-just-call-it-c-26-and-forget-about-the-c-2c-business-at-least-internally/70383
Differential Revision: https://reviews.llvm.org/D150450
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch adds clang options `-mxcoff-roptr` and `-mno-xcoff-roptr` to specify storage locations for constant pointers on AIX.
When the `-mxcoff-roptr` option is in effect, constant pointers, virtual function tables, and virtual type tables are placed in read-only storage. When the `-mno-xcoff-roptr` option is in effect, pointers, virtual function tables, and virtual type tables are placed are placed in read/write storage.
This patch depends on https://reviews.llvm.org/D144189.
Reviewed By: hubert.reinterpretcast, stephenpeckham
Differential Revision: https://reviews.llvm.org/D144190
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch fixes the man page build. It currently doesn't work as
SOURCE_DIR isn't set correctly (just undefined) within the
add_sphinx_target function. This patch also moves around the creation of
targets for autogenerated rst files so that both the man page and html
build can depend upon them as before only the html build depended on
them.
Fixes #62540
Reviewed By: tstellar
Differential Revision: https://reviews.llvm.org/D149809
|
| |
|
|
|
|
|
|
|
| |
and also adds description for default fp environment.
Reviewed By:rjmccall, sepavloff
Differential Revision: https://reviews.llvm.org/D146188
|
|
|
|
| |
https://reviews.llvm.org/rGc5b94ea265133a4a28006929643155fc8fbeafe6 allows N >= 10.
|
|
|
|
|
|
|
|
| |
Reviewed By: aaron.ballman
Spies: H-G-Hristov, cfe-commits
Differential Revision: https://reviews.llvm.org/D150321
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes #60778.
When instantiating the body of a class template specialization that was
instantiated from a partial specialization, we were incorrectly
collecting template arguments from the primary template, which resulted
in the template arguments list being inaccurate. In the example from
the issue, we were trying to substitute the boolean 'false' into the
type on Nested, which caused an assertion.
Differential Revision: https://reviews.llvm.org/D150285
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
MSVC makes these string literals [1][2].
[1] https://godbolt.org/z/6vnTzbExx
[2] https://learn.microsoft.com/en-us/cpp/preprocessor/predefined-macros?view=msvc-170
Fixes #114
Initial commit didn't check if there was a function name when stepping through expressions ignoring parens.
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D146764
|
|
|
|
|
| |
Since the C++20 named modules won't check source files consistency after
5b388f8, it would be better to remove this section in the document.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When the final phase is linking, Clang currently places `.dwo` files in the
current directory (like the `-c` behavior for multiple inputs).
Strangely, -fdebug-compilation-dir=/-ffile-compilation-dir= is considered, which
is untested.
GCC has a more useful behavior that derives auxiliary filenames from the final
output (-o).
```
gcc -c -g -gsplit-dwarf d/a.c d/b.c # a.dwo b.dwo
gcc -g -gsplit-dwarf d/a.c d/b.c -o e/x # e/x-a.dwo e/x-b.dwo
gcc -g -gsplit-dwarf d/a.c d/b.c # a-a.dwo a-b.dwo
```
Port a useful subset of GCC behaviors that are easy to describe to Clang.
* Add a driver and cc1 option -dumpdir
* When the final phase is link, add a default -dumpdir if not specified by the user
* Forward -dumpdir to -cc1 command lines
* tools::SplitDebugName prefers -dumpdir when constructing the .dwo filename
GCC provides -dumpbase. If we use just one of -dumpdir and -dumpbase,
-dumpbase isn't very useful as it appends a dash.
```
gcc -g -gsplit-dwarf -dumpdir e d/a.c # ea.dwo
gcc -g -gsplit-dwarf -dumpdir e/ d/a.c # e/a.dwo
gcc -g -gsplit-dwarf -dumpbase e d/a.c # e-a.dwo
gcc -g -gsplit-dwarf -dumpbase e/ d/a.c # e/-a.dwo
```
If we specify both `-dumpdir` and `-dumpbase`, we can avoid the influence of the
source filename when there is one input file.
```
gcc -g -gsplit-dwarf -dumpdir f/ -dumpbase x d/a.c # f/x.dwo
gcc -g -gsplit-dwarf -dumpdir f/ -dumpbase x d/a.c d/b.c # f/x-a.dwo f/x-b.dwo
```
Given the above examples, I think -dumpbase is not useful.
GCC -save-temps has interesting interaction with -dumpdir as -save-temps
generated files are considered auxiliary files like .dwo files.
For Clang, with this patch, -save-temps and -dumpdir are orthogonal, which is
easier to explain.
```
gcc -g -gsplit-dwarf d/a.c -o e/x -dumpdir f/ -save-temps=obj # e/a.{i,s,o,dwo}
gcc -g -gsplit-dwarf d/a.c -o e/x -save-temps=obj -dumpdir f/ # f/a.{i,s,o,dwo}
clang -g -gsplit-dwarf d/a.c -o e/x -save-temps=obj -dumpdir f/ # e/a.{i,s,o} f/a.dwo
```
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/D149193
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit implements [temp.deduct]p9.
Test updates include:
- New notes in `cxx1y-init-captures.cpp`, `lambda-expressions.cpp`
and 'warn-unused-lambda-capture.cpp'.
This seems to be caused by diagnosing errors earlier (during
deduction) that were previously surfaced later (during
instantiation).
- New error `lambda-unevaluated.cpp` is in line with [temp.deduct]p9.
Reviewed By: erichkeane, #clang-language-wg
Differential Revision: https://reviews.llvm.org/D148802
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before this change a default template argument for a non-type template
parameter was evaluated and checked immediately after it is met by
parser. In some cases it is too early.
Fixes https://github.com/llvm/llvm-project/issues/62224
Fixes https://github.com/llvm/llvm-project/issues/62596
Reviewed By: shafik, erichkeane, cor3ntin
Differential Revision: https://reviews.llvm.org/D150108
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
directly changed
The packed attribute can still be useful in this case if the struct is
then placed inside another packed struct - the non-pod element type's
packed attribute declares that it's OK to misalign this element inside
the packed structure. (otherwise the non-pod element is not packed/its
alignment is preserved, as per D117616/2771233)
Fixes PR62353
Differential Revision: https://reviews.llvm.org/D149182
|
|
|
|
|
|
|
|
| |
Fixes #62462
Reviewed By: #clang-language-wg, erichkeane
Differential Revision: https://reviews.llvm.org/D150036
|
|
|
|
|
|
|
|
| |
-fms-extensions"
This reverts commit 856f384bf94513c89e754906b7d80fbe5377ab53.
Breaks bots, e.g. https://lab.llvm.org/buildbot/#/builders/123/builds/18775
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
MSVC makes these string literals [1][2].
[1] https://godbolt.org/z/6vnTzbExx
[2] https://learn.microsoft.com/en-us/cpp/preprocessor/predefined-macros?view=msvc-170
Fixes #114
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D146764
|
|
|
|
|
|
|
|
|
|
|
| |
Currently clang doesn't verify if the first argument in
`_builtin_assume_aligned` is of pointer type. This leads to an
assertion build failure. This patch aims to add a check if the first
argument is of pointer type or not and diagnose it with
diag::err_typecheck_convert_incompatible if its not of pointer type.
Fixes https://github.com/llvm/llvm-project/issues/62305
Differential Revision: https://reviews.llvm.org/D149514
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
changes from P2448R2
Prior to P2448R2 we were more aggressive in diagnosing ill-formed
constexpr functions. Many of these restrictions were relaxed and now it
is not required for defaulted comparison operators to call constexpr
functions.
This behavior is extended to before C++23 and diagnostic for it's use
can be enabled w/ -pedantic or -Wc++2b-default-comp-relaxed-constexpr
This fixes: https://github.com/llvm/llvm-project/issues/61238
Differential Revision: https://reviews.llvm.org/D146090
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
During the ISO C++ Committee meeting plenary session the C++23 Standard
has been voted as technical complete.
This updates the reference to c++2b to c++23 and updates the __cplusplus
macro.
Drive-by fixes c++1z -> c++17 and c++2a -> c++20 when seen.
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D149553
|
|
|
|
|
|
|
| |
They don't convey any useful information and make the documentation
unnecessarily hard to read.
Differential Revision: https://reviews.llvm.org/D149641
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We filed some CD ballot comments which WG14 considered during the
ballot comment resolution meetings in Jan and Feb 2023, and this
updates our implementation based on the decisions reached. Those
decisions were (paraphrased for brevity):
US 9-034 (REJECTED)
allow (void *)nullptr to be a null pointer constant
US 10-035 (ACCEPTED)
accept the following code, as in C++:
void func(nullptr_t); func(0);
US 22-058 (REJECTED)
accept the following code, as in C++:
nullptr_t val; (void)(1 ? val : 0); (void)(1 ? nullptr : 0);
US 23-062 (REJECTED)
reject the following code, as in C++:
nullptr_t val; bool b1 = val; bool b2 = nullptr;
US 24-061 (ACCEPTED)
accept the following code, as in C++:
nullptr_t val; val = 0;
US 21-068 (ACCEPTED)
accept the following code, as in C++:
(nullptr_t)nullptr;
GB-071 (ACCEPTED)
accept the following code, as in C++:
nullptr_t val; (void)(val == nullptr);
This patch updates the implementation as appropriate, but is primarily
focused around US 10-035, US 24-061, and US 23-062 in terms of
functional changes.
Differential Revision: https://reviews.llvm.org/D148800
|
|
|
|
|
|
|
| |
This reverts commit 22e2db6010b029ebd4c6d3d1fd30224d8b3109ef.
Broke buildbots on Windows. It seems standard headers on Windows contain
flexible array members in unions
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It was rejected in C, and in a strange way accepted in C++. However, the
support was never properly tested and fully implemented, so just reject
it in C++ mode as well.
This change also fixes crash on attempt to initialize union with flexible
array member. Due to missing check on union, there was a null expression
added to init list that caused crash later.
Fixes https://github.com/llvm/llvm-project/issues/61746
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D147626
|
|
|
|
|
|
|
|
|
|
|
|
| |
When constructing an array expression where the index expression
was a pack expansion, we would construct an ArraySubscriptExpr
instead of an CreateOverloadedArraySubscriptExpr, and pack
expansion would not occur - leading a crash during code gen
or a failure during constant evaluation
Reviewed By: erichkeane, shafik
Differential Revision: https://reviews.llvm.org/D149637
|
|
|
|
|
|
|
|
|
| |
Rather than sending a name directly to the stream, use printName
to preserve any PrintingPolicy. This ensures that names are properly
affected by path remapping.
Fixes: https://github.com/llvm/llvm-project/issues/62192
Differential Revision: https://reviews.llvm.org/D149272
|
|
|
|
|
|
|
|
|
|
|
|
| |
`ConvertTypeForMem` doesn't return wider type for _BitInt unless it is
used in a bitfield, so no need to extend when trying to initialize a
global variable.
Fixes https://github.com/llvm/llvm-project/issues/62207
Reviewed By: erichkeane, shafik
Differential Revision: https://reviews.llvm.org/D149436
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes a regression introduced by ca61961380, that would lead
to a segfault due to stack exhaustion when recursively calling
a default member initializer.
Fixes #60082
I'm not able to get clang to emit a stack exhaustion warning,
which it seems like it should be able to.
Reviewed By: shafik
Differential Revision: https://reviews.llvm.org/D142401
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
initialization
Before this patch, initialized class members would have the LifetimeKind
LK_MemInitializer, which does not allow for binding a temporary to a
reference. Binding to a temporary however is allowed in parenthesized
aggregate initialization, even if it leads to a dangling reference. To
fix this, we create a new EntityKind, EK_ParenAggInitMember, which has
LifetimeKind LK_FullExpression.
This patch does *not* attempt to diagnose dangling references as a
result of using this feature.
This patch also refactors TryOrBuildParenListInitialization(...) to
accomodate creating different InitializedEntity objects.
Fixes #61567
[0]: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0960r3.html
Reviewed By: shafik
Differential Revision: https://reviews.llvm.org/D148274
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
aggregate types
Previously, when checking whether an in-class initializer exists when
performing parenthesized aggregate initialization, Clang checks that the
output of FieldDecl::getInClassInitializer() is non-null. This is
incorrect; if the field is part of a templated type, then
getInClassInitializer() will return nullptr if we haven't called
Sem::BuildCXXDefaultInitExpr(...) before, even if
FieldDecl::hasInClassInitializer() returns true. The end result is that
Clang incorrectly ignores the in class initializer and
value-initializes the field. The fix therefore is to instead call
FieldDecl::hasInClassInitializer(), which is what we do for braced init
lists [0].
Before this patch, Clang does correctly recognize the in-class field
initializer in certain cases. This is Sema::BuildCXXDefaultInitExpr(...)
populates the in class initializer of the corresponding FieldDecl
object. Therefore, if that method was previously called with the same
FieldDecl object, as can happen with a decltype(...) or a braced list
initialization, FieldDecl::getInClassInitializer() will return a
non-null expression, and the field becomes properly initialized.
Fixes 62266
[0]: https://github.com/llvm/llvm-project/blob/be5f35e24f4c15caf3c4aeccddc54c52560c28a0/clang/lib/Sema/SemaInit.cpp#L685
Reviewed By: shafik
Differential Revision: https://reviews.llvm.org/D149389
|
|
|
|
|
|
|
| |
In its place, add a description of a bug that the change introducing
the bug in question inadvertently fixed.
See BZ 62361 for more details.
|
|
|
|
|
|
|
|
|
| |
The option allows users to specify how many columns to use to indent
the contents of initializer lists.
Closes #51070.
Differential Revision: https://reviews.llvm.org/D146101
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
arm_sve_vector_bits.
This allows the user to set the size of the scalable vector so they
can be used in structs and as the type of global variables. This works
by representing the type as a fixed vector instead of a scalable vector
in IR. Conversions to and from scalable vectors are made where necessary
like function arguments/returns and intrinsics.
This features has been requested here
https://github.com/riscv-non-isa/rvv-intrinsic-doc/issues/176
I know arm_sve_vector_bits is used by the Eigen library so this
could be used to port Eigen to RVV.
This patch adds a new preprocessor define `__riscv_v_fixed_vlen` that
is set when -mrvv_vector_bits is passed on the command line.
The code is largely based on the AArch64 code. A lot of code was
copy/pasted and then modiied to RVV. There may be some opportunities
for sharing.
This first patch only supports the LMUL=1 types. Additional changes
will be needed to support other LMULs. I have also not supported
mask vectors.
Differential Revision: https://reviews.llvm.org/D145088
|
|
|
|
|
|
|
|
|
|
| |
Clang accepts preserve_all for AArch64 while it is missing form the backed.
Fixes #58145
Reviewed By: efriedma
Differential Revision: https://reviews.llvm.org/D135652
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
expr.prim.lambda.capture p5 says:
If an identifier in a capture appears as the declarator-id of a parameter of
the lambda-declarator's parameter-declaration-clause or as the name of a
template parameter of the lambda-expression's template-parameter-list,
the program is ill-formed.
and also has the following example:
```
auto h = [y = 0]<typename y>(y) { return 0; };
```
which now results in
```
error: declaration of 'y' shadows template parameter
auto l1 = [y = 0]<typename y>(y) { return 0; };
^
note: template parameter is declared here
auto l1 = [y = 0]<typename y>(y) { return 0; };
^
```
Fixes https://github.com/llvm/llvm-project/issues/61105
Reviewed By: shafik, cor3ntin
Differential Revision: https://reviews.llvm.org/D148712
|