History log of /llvm-project/clang/unittests/AST/ASTImporterTest.cpp (Results 1 – 25 of 306)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-21-init
# f94c4815 27-Jan-2025 antangelo <contact@antangelo.com>

[clang] Track source deduction guide for alias template deduction guides (#123875)

For deduction guides generated from alias template CTAD, store the
deduction guide they were originated from. The s

[clang] Track source deduction guide for alias template deduction guides (#123875)

For deduction guides generated from alias template CTAD, store the
deduction guide they were originated from. The source kind is also
maintained for future expansion in CTAD from inherited constructors.

This tracking is required to determine whether an alias template already
has a deduction guide corresponding to some deduction guide on the
original template, in order to support deduction guides for the alias
from deduction guides declared after the initial usage.

show more ...


# 5c5bbffe 27-Jan-2025 Michael Buch <michaelbuch12@gmail.com>

[clang][ASTImporter] Import source location of explicit object parameter instead of copying it (#124305)

We used to copy the `SourceLocation` instead of importing it, which
isn't correct since the

[clang][ASTImporter] Import source location of explicit object parameter instead of copying it (#124305)

We used to copy the `SourceLocation` instead of importing it, which
isn't correct since the `SourceManager`'s of the source and target
ASTContext might differ.

Also adds test that confirms that we import the explicit object
parameter location for `ParmVarDecl`s. This is how Clang determines
whether a parameter `isExplicitObjectParamater`. The LLDB expression
evaluator relies on this for calling "explicit object member functions".

show more ...


Revision tags: llvmorg-19.1.7
# 7e01a322 13-Jan-2025 Balázs Kéri <balazs.keri@ericsson.com>

[clang][ASTImporter] Fix unused variable warning (NFC) (#122686)


# b270525f 13-Jan-2025 Balázs Kéri <balazs.keri@ericsson.com>

[clang][ASTImporter] Not using primary context in lookup table (#118466)

`ASTImporterLookupTable` did use the `getPrimaryContext` function to get
the declaration context of the inserted items. This

[clang][ASTImporter] Not using primary context in lookup table (#118466)

`ASTImporterLookupTable` did use the `getPrimaryContext` function to get
the declaration context of the inserted items. This is problematic
because the primary context can change during import of AST items, most
likely if a definition of a previously not defined class is imported.
(For any record the primary context is the definition if there is one.)
The use of primary context is really not important, only for namespaces
because these can be re-opened and lookup in one namespace block is not
enough. This special search is now moved into ASTImporter instead of
relying on the lookup table.

show more ...


# a3e62d84 11-Jan-2025 Kazu Hirata <kazu@google.com>

[AST] Fix a warning

This patch fixes:

clang/unittests/AST/ASTImporterTest.cpp:3397:9: error: unused
variable 'ToTU' [-Werror,-Wunused-variable]


# cfe26358 11-Jan-2025 Timm Baeder <tbaeder@redhat.com>

Reapply "[clang] Avoid re-evaluating field bitwidth" (#122289)


# 59bdea24 08-Jan-2025 Timm Bäder <tbaeder@redhat.com>

Revert "[clang] Avoid re-evaluating field bitwidth (#117732)"

This reverts commit 81fc3add1e627c23b7270fe2739cdacc09063e54.

This breaks some LLDB tests, e.g.
SymbolFile/DWARF/x86/no_unique_address-

Revert "[clang] Avoid re-evaluating field bitwidth (#117732)"

This reverts commit 81fc3add1e627c23b7270fe2739cdacc09063e54.

This breaks some LLDB tests, e.g.
SymbolFile/DWARF/x86/no_unique_address-with-bitfields.cpp:

lldb: ../llvm-project/clang/lib/AST/Decl.cpp:4604: unsigned int clang::FieldDecl::getBitWidthValue() const: Assertion `isa<ConstantExpr>(getBitWidth())' failed.

show more ...


# 81fc3add 08-Jan-2025 Timm Baeder <tbaeder@redhat.com>

[clang] Avoid re-evaluating field bitwidth (#117732)

Save the bitwidth value as a `ConstantExpr` with the value set. Remove
the `ASTContext` parameter from `getBitWidthValue()`, so the latter
simply

[clang] Avoid re-evaluating field bitwidth (#117732)

Save the bitwidth value as a `ConstantExpr` with the value set. Remove
the `ASTContext` parameter from `getBitWidthValue()`, so the latter
simply returns the value from the `ConstantExpr` instead of
constant-evaluating the bitwidth expression every time it is called.

show more ...


# d85b22ed 03-Jan-2025 kefan cao <45958009+caokefan@users.noreply.github.com>

[Clang][ASTMatcher] Add `dependentTemplateSpecializationType` matcher (#121435)

Fixes https://github.com/llvm/llvm-project/issues/121307


# 6230f1ba 30-Dec-2024 Amr Hesham <amr96@programmer.net>

[Clang][ASTMatcher] Add `dependentNameType` AST matcher (#121263)

Fixes: https://github.com/llvm/llvm-project/issues/121240


# 48bf0a94 28-Dec-2024 Amr Hesham <amr96@programmer.net>

[Clang][ASTMatcher] Add `dependentScopeDeclRefExpr` matcher (#120996)

Fixes https://github.com/llvm/llvm-project/issues/120937


Revision tags: llvmorg-19.1.6
# c35108e2 14-Dec-2024 Kazu Hirata <kazu@google.com>

[AST] Migrate away from PointerUnion::get (NFC) (#119949)

Note that PointerUnion::get has been soft deprecated in
PointerUnion.h:

// FIXME: Replace the uses of is(), get() and dyn_cast() with

[AST] Migrate away from PointerUnion::get (NFC) (#119949)

Note that PointerUnion::get has been soft deprecated in
PointerUnion.h:

// FIXME: Replace the uses of is(), get() and dyn_cast() with
// isa<T>, cast<T> and the llvm::dyn_cast<T>

show more ...


Revision tags: llvmorg-19.1.5
# 7be501c1 02-Dec-2024 Balázs Kéri <balazs.keri@ericsson.com>

[clang][ASTImporter] Allow import of similar friend template with different depth (#115734)

This fix applies to a case that occurs when the AST contains a friend
template that is contained within a

[clang][ASTImporter] Allow import of similar friend template with different depth (#115734)

This fix applies to a case that occurs when the AST contains a friend
template that is contained within another template and this (outer)
template has specialization. (See the added test code in the commit.)

show more ...


Revision tags: llvmorg-19.1.4, llvmorg-19.1.3
# 55cbbce0 18-Oct-2024 Balázs Kéri <balazs.keri@ericsson.com>

[clang][ASTImporter] Fix of unchecked Error object (#112688)

After commits 9c72a30 and 30a9cac error handling in function
'importTemplateParameterDefaultArgument' was not correct,
probably related

[clang][ASTImporter] Fix of unchecked Error object (#112688)

After commits 9c72a30 and 30a9cac error handling in function
'importTemplateParameterDefaultArgument' was not correct,
probably related to (not) using std::move. A crash with unchecked
Error result could happen when the import error path was taken.

Here a test is added that reproduces this case and the problem is
fixed.

show more ...


Revision tags: llvmorg-19.1.2, llvmorg-19.1.1, llvmorg-19.1.0
# 9c72a308 06-Sep-2024 Balázs Kéri <balazs.keri@ericsson.com>

[clang][ASTImporter] New fix for default template parameter values. (#101836)

Commit e4440b8 added a change that introduced new crash in an
incorrectly handled case. This is fixed here. Default arg

[clang][ASTImporter] New fix for default template parameter values. (#101836)

Commit e4440b8 added a change that introduced new crash in an
incorrectly handled case. This is fixed here. Default argument
definition or inheritance is preserved in the "To" AST compared to
the "From". If the default argument is defined already in the "To"
AST it can be duplicated at the import.

show more ...


Revision tags: llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3
# a58f20b5 07-Aug-2024 Ding Fei <fding@feysh.com>

[clang][ASTImporter] support import return with UnaryTransformType (#101517)

This fixes infinite recursion crash on return with UnaryTransformType,
whose underlying type is a SubstTemplateTypeParmT

[clang][ASTImporter] support import return with UnaryTransformType (#101517)

This fixes infinite recursion crash on return with UnaryTransformType,
whose underlying type is a SubstTemplateTypeParmType which is
associated with current imported function.

show more ...


# 5518b46c 07-Aug-2024 Ding Fei <fding@feysh.com>

[clang][ASTImporter] Remove trailing return testing on lambda proto (#101031)

Lambdas without trailing return could also have return type defined
inside its body.

This fixes crashes (infinite re

[clang][ASTImporter] Remove trailing return testing on lambda proto (#101031)

Lambdas without trailing return could also have return type defined
inside its body.

This fixes crashes (infinite recursion) on lambda expr without
parameters (no parentheses).

show more ...


Revision tags: llvmorg-19.1.0-rc2
# 518d8632 30-Jul-2024 Balázs Kéri <balazs.keri@ericsson.com>

[clang][ASTImporter] Fix import of template parameter default values. (#100100)

Default values of template parameters (non-type, type, template) were
not correctly handled in the "inherited" case.

[clang][ASTImporter] Fix import of template parameter default values. (#100100)

Default values of template parameters (non-type, type, template) were
not correctly handled in the "inherited" case. This occurs if the first
declaration contains the default value but a next one not. The default
value is "inherited" from the first.

In ASTImporter it was only possible to set the inherited status after
the template object was created with the template parameters that were
imported without handling the inherited case. The import function of the
template parameter contains not enough information (previous
declaration) to set the inherited-from status. After the template was
created, default value of the parameters that should be inherited is
reset to inherited mode.

show more ...


# 31769e4d 29-Jul-2024 Michael Buch <michaelbuch12@gmail.com>

Revert "Reland [clang][ASTImport] Add support for import of empty records" (#100903)

This reverts commit 88e5206f2c96a34e23a4d63f0a38afb2db044f0a. The
original change went in a while ago (last year

Revert "Reland [clang][ASTImport] Add support for import of empty records" (#100903)

This reverts commit 88e5206f2c96a34e23a4d63f0a38afb2db044f0a. The
original change went in a while ago (last year) in
https://reviews.llvm.org/D145057. The specific reason I'm proposing a
revert is that this is now causing exactly the issue that @balazske
predicted in https://reviews.llvm.org/D145057#4164717:
> Problematic case is if the attribute has pointer to a Decl or Type
that is imported here in a state when the field is already created but
not initialized. Another problem is that attributes are added a second
time in Import(Decl *)

This now came up in the testing of LLDB support for
https://github.com/llvm/llvm-project/issues/93069. There,
`__compressed_pair`s are now replaced with fields that have an
`alignof(...)` and `[[no_unique_address]]` attribute. In the specific
failing case, we're importing following `std::list` method:
```
size_type& __sz() _NOEXCEPT { return __size_; }
```
During this process, we create a new `__size_` `FieldDecl` (but don't
initialize it yet). Then we go down the `ImportAttrs` codepath added in
D145057. This imports the `alignof` expression which then references the
uninitialized `__size_` and we trigger an assertion.

Important to note, this codepath was added specifically to support
`[[no_unique_address]]` in LLDB, and was supposed to land with
https://reviews.llvm.org/D143347. But the LLDB side of that never
landed, and the way we plan to support `[[no_unique_address]]` doesn't
require things like the `markEmpty` method added here. So really, this
is a dead codepath, which as pointed out in the original review isn't
fully sound.

show more ...


Revision tags: llvmorg-19.1.0-rc1
# 978c40b4 26-Jul-2024 Ding Fei <fding@feysh.com>

[clang][ASTImporter][NFC] add unittests for unnamed EnumDecl (#100545)

These tests are for multiple anonymous EnumDecls structural eq test &
importing.

We found the anonymous enums importing iss

[clang][ASTImporter][NFC] add unittests for unnamed EnumDecl (#100545)

These tests are for multiple anonymous EnumDecls structural eq test &
importing.

We found the anonymous enums importing issue a few days ago and tried to
fix it
but 0a6233a68c7b575d05bca0f0c708b7e97cc710d1 already did this. I think
these tests are still useful for regressions.

show more ...


Revision tags: llvmorg-20-init
# 0a6233a6 23-Jul-2024 Balázs Kéri <balazs.keri@ericsson.com>

[clang][ASTImporter] Fix import of anonymous enums if multiple are present (#99281)

After changes in PR #87144 and #93923 regressions appeared in some
cases. The problem was that if multiple anonym

[clang][ASTImporter] Fix import of anonymous enums if multiple are present (#99281)

After changes in PR #87144 and #93923 regressions appeared in some
cases. The problem was that if multiple anonymous enums are present in a
class and are imported as new the import of the second enum can fail
because it is detected as different from the first and causes ODR error.

Now in case of enums without name an existing similar enum is searched,
if not found the enum is imported. ODR error is not detected. This may
be incorrect if non-matching structures are imported, but this is the
less important case (import of matching classes is more important to
work).

show more ...


# d6987606 01-Jul-2024 Dan McArdle <dmcardle@google.com>

[clang][ThreadSafety] Revert stricter typing on trylock attributes (#97293)

This PR reverts #95290 and the one-liner followup PR #96494.

I received some substantial feedback on #95290, which I pl

[clang][ThreadSafety] Revert stricter typing on trylock attributes (#97293)

This PR reverts #95290 and the one-liner followup PR #96494.

I received some substantial feedback on #95290, which I plan to address
in a future PR.

I've also received feedback that because the change emits errors where
they were not emitted before, we should at least have a flag to disable
the stricter warnings.

show more ...


# c1bde0a2 24-Jun-2024 Dan McArdle <zingermc@gmail.com>

[clang][ThreadSafety] Check trylock function success and return types (#95290)

With this change, Clang will generate errors when trylock functions have
improper return types. Today, it silently fai

[clang][ThreadSafety] Check trylock function success and return types (#95290)

With this change, Clang will generate errors when trylock functions have
improper return types. Today, it silently fails to apply the trylock
attribute to these functions which may incorrectly lead users to believe
they have correctly acquired locks before accessing guarded data.

As a side effect of explicitly checking the success argument type, I
seem to have fixed a false negative in the analysis that could occur
when a trylock's success argument is an enumerator. I've added a
regression test to warn-thread-safety-analysis.cpp named
`TrylockSuccessEnumFalseNegative`.

This change also improves the documentation with descriptions of of the
subtle gotchas that arise from the analysis interpreting the success arg
as a boolean.

Issue #92408

show more ...


Revision tags: llvmorg-18.1.8, llvmorg-18.1.7
# 3b020d51 04-Jun-2024 Qizhi Hu <836744285@qq.com>

[clang][ASTImport] fix issue on anonymous enum import (#93923)

Don't skip searching in `ToContext` during importing `EnumDecl`. And
`IsStructuralMatch` in `StructralEquivalence` can make sure to de

[clang][ASTImport] fix issue on anonymous enum import (#93923)

Don't skip searching in `ToContext` during importing `EnumDecl`. And
`IsStructuralMatch` in `StructralEquivalence` can make sure to determine
whether the found result is match or not.

---------

Co-authored-by: huqizhi <836744285@qq.com>

show more ...


# 2bde13cd 22-May-2024 Matheus Izvekov <mizvekov@gmail.com>

[clang] NFCI: use TemplateArgumentLoc for NTTP DefaultArgument (#92852)

This is an enabler for https://github.com/llvm/llvm-project/pull/92855

This allows an NTTP default argument to be set as an a

[clang] NFCI: use TemplateArgumentLoc for NTTP DefaultArgument (#92852)

This is an enabler for https://github.com/llvm/llvm-project/pull/92855

This allows an NTTP default argument to be set as an arbitrary
TemplateArgument, not just an expression.
This allows template parameter packs to have default arguments in the
AST, even though the language proper doesn't support the syntax for it.

This allows NTTP default arguments to be other kinds of arguments, like
packs, integral constants, and such.

show more ...


12345678910>>...13