[clang] [clang-tools-extra] [lldb] Reland: [clang] preserve class type sugar when taking pointer to member (PR #132401)

2025-04-29 Thread via cfe-commits

gulfemsavrun wrote:

We started seeing the following issue, and bisected to this commit.
```
test.cpp:8:12: error: no matching function for call to 'GetFieldChecked'
8 | return GetFieldChecked(b, 
&std::remove_reference::type::has_total);
  |^~~
test.cpp:6:5: note: candidate template ignored: deduced conflicting types for 
parameter 'Table' ('Bar' vs. 'const Bar')
6 | int GetFieldChecked(const Table&, bool (Table::*)() const);
  | ^
1 error generate
```

Here's a small test case:
```
#include 
struct Bar {
  bool has_total() const;
};
template 
int GetFieldChecked(const Table&, bool (Table::*)() const);
int foo(const Bar& b) { 
return GetFieldChecked(b, 
&std::remove_reference::type::has_total);
}
```

If we just compile it via `clang++ -c test.cpp` with this commit, we ran into 
this issue and it is blocking us to roll Clang in our project.


https://github.com/llvm/llvm-project/pull/132401
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [lldb] Reland: [clang] preserve class type sugar when taking pointer to member (PR #132401)

2025-04-23 Thread Matheus Izvekov via cfe-commits

mizvekov wrote:

@emaxx-google thanks for the reproducer.

I will be off to C++Now soon, so it's unlikely I will have time to take a look 
at
that in the next two weeks, sorry about that.

https://github.com/llvm/llvm-project/pull/132401
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [lldb] Reland: [clang] preserve class type sugar when taking pointer to member (PR #132401)

2025-04-23 Thread Maksim Ivanov via cfe-commits

emaxx-google wrote:

Hello, the minimized reproducer for the determinism issue is there: 
https://pastebin.com/6aL6rmBe . To build it, unpack it into separate files (via 
`split-file`), then run `CLANG=path/to/clang make`. The nondeterminism can be 
checked by looping `make clean` + `make` + `md5sum problem.pcm` - typically a 
different hash pops up after a few dozens of iterations.

https://github.com/llvm/llvm-project/pull/132401
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [lldb] Reland: [clang] preserve class type sugar when taking pointer to member (PR #132401)

2025-04-15 Thread via cfe-commits

eaeltsin wrote:

No, the problem seems to be in serialization/deserialization, there must be 
some mismatch between `ASTStmtWriter::VisitSubstNonTypeTemplateParmExpr` and 
`ASTStmtReader::VisitSubstNonTypeTemplateParmExpr`.

More precisely, I'm seeing that 
`ASTStmtWriter::VisitSubstNonTypeTemplateParmExpr` outputs a record of 5 
elements, while `ASTStmtReader::VisitSubstNonTypeTemplateParmExpr` gets a 
record of 4 elements as input, and thus triggers assertion when reading the 
source location.


https://github.com/llvm/llvm-project/pull/132401
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [lldb] Reland: [clang] preserve class type sugar when taking pointer to member (PR #132401)

2025-04-14 Thread Matheus Izvekov via cfe-commits

mizvekov wrote:

Could it be you are hitting an overflow/wrap around perhaps?

Some of these nodes store the unsignedOrNone representation in a bitfield, but 
that's still 15 bits.

https://github.com/llvm/llvm-project/pull/132401
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [lldb] Reland: [clang] preserve class type sugar when taking pointer to member (PR #132401)

2025-04-14 Thread via cfe-commits

eaeltsin wrote:

Comparing bcanalyzer --dump outputs for non-deterministic pcms, I see a lot of 
op values that differ by 1.

I wonder if this might be something like the mismatch of Read Write 
UnsignedOrNone vs unsigned ...


https://github.com/llvm/llvm-project/pull/132401
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [lldb] Reland: [clang] preserve class type sugar when taking pointer to member (PR #132401)

2025-04-14 Thread Matheus Izvekov via cfe-commits

mizvekov wrote:

In one of these changes we did bump one of these bit fields down to 15 bits, 
starting from 16.

https://github.com/llvm/llvm-project/pull/132401
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [lldb] Reland: [clang] preserve class type sugar when taking pointer to member (PR #132401)

2025-04-14 Thread via cfe-commits

eaeltsin wrote:

Didn't fire so far.

Though this is non-deterministic, I might be (un)lucky.


https://github.com/llvm/llvm-project/pull/132401
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [lldb] Reland: [clang] preserve class type sugar when taking pointer to member (PR #132401)

2025-04-14 Thread Matheus Izvekov via cfe-commits

mizvekov wrote:

One thing that looks fishy, but that is even a different node, is this early 
return on `VisitSubstNonTypeTemplateParmPackExpr` in `ASTReaderStmt`.

```C++
  if (ArgPack.getKind() != TemplateArgument::Pack)
return;
```

This looks impossible to hit, because `getArgumentPack` calls a constructor 
which can only return Packs.

Can you turn that into an assert and try again?

```C++
assert (ArgPack.getKind() == TemplateArgument::Pack);
```

https://github.com/llvm/llvm-project/pull/132401
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [lldb] Reland: [clang] preserve class type sugar when taking pointer to member (PR #132401)

2025-04-14 Thread via cfe-commits

eaeltsin wrote:

Using library with assertions, I'm seeing out-of-bounds source location read 
called from `ASTStmtReader::VisitSubstNonTypeTemplateParmExpr` - 
[trace](https://gist.github.com/eaeltsin/845fb9cc6f65f47ed03a64aca5aff923)

https://github.com/llvm/llvm-project/pull/132401
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [lldb] Reland: [clang] preserve class type sugar when taking pointer to member (PR #132401)

2025-04-11 Thread via cfe-commits

eaeltsin wrote:

Patched #135450 but still see the same MSan finding on my compilation - 
uninitialized value while checking location validity in 
`TranslateSourceLocation` called from `VisitSubstNonTypeTemplateParmExpr`.

Sorry but I'm not yet sure how to strip the reproducer from internal code so 
cannot provide it :|


https://github.com/llvm/llvm-project/pull/132401
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [lldb] Reland: [clang] preserve class type sugar when taking pointer to member (PR #132401)

2025-04-11 Thread Matheus Izvekov via cfe-commits

mizvekov wrote:

Thanks for that stack trace, could be unrelated to this, but that still helped 
find a bug: https://github.com/llvm/llvm-project/pull/135450

https://github.com/llvm/llvm-project/pull/132401
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [lldb] Reland: [clang] preserve class type sugar when taking pointer to member (PR #132401)

2025-04-11 Thread via cfe-commits

eaeltsin wrote:

Well, to be honest, I'm not completely sure these are the same problems, these 
are just sanitizer finding for the same compilation.

Here is the [MSan 
finding](https://gist.github.com/eaeltsin/834192fe5d8bbbc061e1488f113e34e1). 
Please note my source is somewhat behind the head, so locations might be off a 
bit


https://github.com/llvm/llvm-project/pull/132401
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [lldb] Reland: [clang] preserve class type sugar when taking pointer to member (PR #132401)

2025-04-11 Thread Matheus Izvekov via cfe-commits

mizvekov wrote:

Do you have a backtrace of that uninitialized read?

https://github.com/llvm/llvm-project/pull/132401
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [lldb] Reland: [clang] preserve class type sugar when taking pointer to member (PR #132401)

2025-04-11 Thread Matheus Izvekov via cfe-commits

mizvekov wrote:

Okay, if the problem is an uninitialized source location somewhere, then that 
patch doesn't help at all.

https://github.com/llvm/llvm-project/pull/132401
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [lldb] Reland: [clang] preserve class type sugar when taking pointer to member (PR #132401)

2025-04-11 Thread via cfe-commits

eaeltsin wrote:

@mizvekov - no, the patch doesn't help, or I did something wrong.


https://github.com/llvm/llvm-project/pull/132401
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [lldb] Reland: [clang] preserve class type sugar when taking pointer to member (PR #132401)

2025-04-11 Thread via cfe-commits

eaeltsin wrote:

Memory Sanitizer complains about initialized value 
[here](https://github.com/llvm/llvm-project/blob/main/clang/include/clang/Serialization/ASTReader.h#L2438)

Will try the patch now.

https://github.com/llvm/llvm-project/pull/132401
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [lldb] Reland: [clang] preserve class type sugar when taking pointer to member (PR #132401)

2025-04-11 Thread Matheus Izvekov via cfe-commits

mizvekov wrote:

@eaeltsin speculative fix here, but can you try with this patch? 
https://github.com/llvm/llvm-project/pull/135434

https://github.com/llvm/llvm-project/pull/132401
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [lldb] Reland: [clang] preserve class type sugar when taking pointer to member (PR #132401)

2025-04-10 Thread Matheus Izvekov via cfe-commits

mizvekov wrote:

> We are now seeing non-determinism in `.pcm` files that root-causes to this 
> commit.
> 
> @mizvekov - might it be something obvious, like pointer-keyed containers or 
> similar?

I don't see anything obvious. The only parts of the patch which touch anything 
similar to pointer-keyed containers are the type properties cache changes, like 
the linkage computation.

https://github.com/llvm/llvm-project/pull/132401
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [lldb] Reland: [clang] preserve class type sugar when taking pointer to member (PR #132401)

2025-04-10 Thread via cfe-commits

eaeltsin wrote:

We are now seeing non-determinism in `.pcm` files that root-causes to this 
commit.

@mizvekov - might it be something obvious, like pointer-keyed containers or 
similar?


https://github.com/llvm/llvm-project/pull/132401
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [lldb] Reland: [clang] preserve class type sugar when taking pointer to member (PR #132401)

2025-04-10 Thread Arthur Eubanks via cfe-commits

aeubanks wrote:

@mizvekov we're seeing pcm non-determinism after this reland, does anything 
jump out at you?

https://github.com/llvm/llvm-project/pull/132401
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [lldb] Reland: [clang] preserve class type sugar when taking pointer to member (PR #132401)

2025-04-05 Thread via cfe-commits

earnol wrote:

Could you please look into https://github.com/llvm/llvm-project/issues/133144? 
It looks like to be caused by your change.

https://github.com/llvm/llvm-project/pull/132401
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [lldb] Reland: [clang] preserve class type sugar when taking pointer to member (PR #132401)

2025-04-05 Thread Jordan Rupprecht via cfe-commits

rupprecht wrote:

Still seeing a crash even with the latest fix applied
```
assertion failed at clang/include/clang/AST/Type.h:945 in const 
ExtQualsTypeCommonBase *clang::QualType::getCommonPtr() const: !isNull() && 
"Cannot retrieve a NULL type pointer"
*** Check failure stack trace: ***
@ 0x55e0dffed1f5  DeduceTemplateArgumentsByTypeMatch()
@ 0x55e0dffecc3e  DeduceTemplateArgumentsByTypeMatch()
@ 0x55e0dfff79f1  DeduceTemplateArguments()
@ 0x55e0dffe3ce9  DeduceTemplateArguments()
@ 0x55e0dffe47c0  clang::Sema::DeduceTemplateArguments()
@ 0x55e0e008943b  clang::Sema::InstantiateClassTemplateSpecialization()
@ 0x55e0e018b8a3  llvm::function_ref<>::callback_fn<>()
@ 0x55e0e0b04caf  
clang::StackExhaustionHandler::runWithSufficientStackSpace()
@ 0x55e0e01741a8  clang::Sema::RequireCompleteTypeImpl()
@ 0x55e0e01739b5  clang::Sema::RequireCompleteType()
@ 0x55e0df8e6914  clang::Sema::RequireCompleteDeclContext()
@ 0x55e0dfd44fa9  clang::Sema::LookupParsedName()
@ 0x55e0dfb3b113  clang::Sema::BuildQualifiedDeclarationNameExpr()
@ 0x55e0e00d83e8  
clang::TreeTransform<>::TransformDependentScopeDeclRefExpr()
@ 0x55e0e00d2529  clang::TreeTransform<>::TransformCallExpr()
@ 0x55e0e00ef218  clang::TreeTransform<>::TransformReturnStmt()
@ 0x55e0e00d9018  clang::TreeTransform<>::TransformCompoundStmt()
@ 0x55e0e008aa0a  clang::Sema::SubstStmt()
@ 0x55e0e011f3ce  clang::Sema::InstantiateFunctionDefinition()
@ 0x55e0e0b04caf  
clang::StackExhaustionHandler::runWithSufficientStackSpace()
@ 0x55e0dffed9d6  clang::Sema::DeduceReturnType()
@ 0x55e0dfb2bac5  clang::Sema::DiagnoseUseOfDecl()
@ 0x55e0dfeb8361  FinishOverloadedCallExpr()
@ 0x55e0dfeb8274  clang::Sema::BuildOverloadedCallExpr()
@ 0x55e0dfb322ba  clang::Sema::BuildCallExpr()
@ 0x55e0dfb492b8  clang::Sema::ActOnCallExpr()
@ 0x55e0e00d2704  clang::TreeTransform<>::TransformCallExpr()
@ 0x55e0e008d052  clang::TreeTransform<>::TransformExprs()
@ 0x55e0e00d258c  clang::TreeTransform<>::TransformCallExpr()
@ 0x55e0e008d052  clang::TreeTransform<>::TransformExprs()
@ 0x55e0e00d258c  clang::TreeTransform<>::TransformCallExpr()
@ 0x55e0e00ef218  clang::TreeTransform<>::TransformReturnStmt()
@ 0x55e0e00d9018  clang::TreeTransform<>::TransformCompoundStmt()
@ 0x55e0e008aa0a  clang::Sema::SubstStmt()
@ 0x55e0e011f3ce  clang::Sema::InstantiateFunctionDefinition()
@ 0x55e0e01227ba  clang::Sema::PerformPendingInstantiations()
@ 0x55e0df88aaac  clang::Sema::ActOnEndOfTranslationUnitFragment()
@ 0x55e0df88b22b  clang::Sema::ActOnEndOfTranslationUnit()
@ 0x55e0df5a1e5a  clang::Parser::ParseTopLevelDecl()
@ 0x55e0df59e05e  clang::ParseAST()
...
```
In the meantime, I'll try reducing this

https://github.com/llvm/llvm-project/pull/132401
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [lldb] Reland: [clang] preserve class type sugar when taking pointer to member (PR #132401)

2025-04-04 Thread Matheus Izvekov via cfe-commits

mizvekov wrote:

@nico thanks, that's landed. Let me know if it's all green now, otherwise we 
proceed with the revert.

https://github.com/llvm/llvm-project/pull/132401
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [lldb] Reland: [clang] preserve class type sugar when taking pointer to member (PR #132401)

2025-03-30 Thread Matheus Izvekov via cfe-commits

mizvekov wrote:

> > @alexfh should be fixed by #133613
> 
> 
> 
> Thank you! The crash is resolved. Do you still need a reduced test case?

No worries, the tests included in PR already reproduce it.

https://github.com/llvm/llvm-project/pull/132401
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [lldb] Reland: [clang] preserve class type sugar when taking pointer to member (PR #132401)

2025-03-30 Thread Alexander Kornienko via cfe-commits

alexfh wrote:

> @alexfh should be fixed by #133613

Thank you! The crash is resolved. Do you still need a reduced test case?

https://github.com/llvm/llvm-project/pull/132401
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [lldb] Reland: [clang] preserve class type sugar when taking pointer to member (PR #132401)

2025-03-29 Thread Matheus Izvekov via cfe-commits

mizvekov wrote:

@alexfh should be fixed by https://github.com/llvm/llvm-project/pull/133613

https://github.com/llvm/llvm-project/pull/132401
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [lldb] Reland: [clang] preserve class type sugar when taking pointer to member (PR #132401)

2025-03-29 Thread Alexander Kornienko via cfe-commits

alexfh wrote:

I've found a new crash that's not fixed by 
https://github.com/llvm/llvm-project/pull/133343. Reducing...

https://github.com/llvm/llvm-project/pull/132401
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [lldb] Reland: [clang] preserve class type sugar when taking pointer to member (PR #132401)

2025-03-28 Thread via cfe-commits

llvmbot wrote:



@llvm/pr-subscribers-clang-tools-extra

@llvm/pr-subscribers-lldb

Author: Matheus Izvekov (mizvekov)


Changes

Original PR: #130537
Originally reverted due to revert of dependent commit. Relanding with no 
changes.

This changes the MemberPointerType representation to use a NestedNameSpecifier 
instead of a Type to represent the base class.

Since the qualifiers are always parsed as nested names, there was an impedance 
mismatch when converting these back and forth into types, and this led to 
issues in preserving sugar.

The nested names are indeed a better match for these, as the differences which 
a QualType can represent cannot be expressed syntatically, and they represent 
the use case more exactly, being either dependent or referring to a CXXRecord, 
unqualified.

This patch also makes the MemberPointerType able to represent sugar for a 
{up/downcast}cast conversion of the base class, although for now the underlying 
type is canonical, as preserving the sugar up to that point requires further 
work.

As usual, includes a few drive-by fixes in order to make use of the 
improvements.

---

Patch is 143.32 KiB, truncated to 20.00 KiB below, full version: 
https://github.com/llvm/llvm-project/pull/132401.diff


71 Files Affected:

- (modified) clang-tools-extra/clang-tidy/modernize/UseNullptrCheck.cpp (+1-2) 
- (modified) clang-tools-extra/clang-tidy/utils/ExceptionAnalyzer.cpp (+3-1) 
- (modified) clang-tools-extra/clangd/unittests/FindTargetTests.cpp (+1-1) 
- (modified) clang/docs/ReleaseNotes.rst (+1) 
- (modified) clang/include/clang/AST/ASTContext.h (+3-4) 
- (modified) clang/include/clang/AST/ASTNodeTraverser.h (+5-2) 
- (modified) clang/include/clang/AST/CanonicalType.h (+1-1) 
- (modified) clang/include/clang/AST/RecursiveASTVisitor.h (+5-4) 
- (modified) clang/include/clang/AST/Type.h (+15-13) 
- (modified) clang/include/clang/AST/TypeLoc.h (+19-14) 
- (modified) clang/include/clang/AST/TypeProperties.td (+6-3) 
- (modified) clang/include/clang/Basic/DiagnosticSemaKinds.td (+2-4) 
- (modified) clang/include/clang/Sema/Sema.h (+9-2) 
- (modified) clang/lib/AST/ASTContext.cpp (+47-21) 
- (modified) clang/lib/AST/ASTImporter.cpp (+9-5) 
- (modified) clang/lib/AST/ASTStructuralEquivalence.cpp (+6-2) 
- (modified) clang/lib/AST/ItaniumMangle.cpp (+10-1) 
- (modified) clang/lib/AST/NestedNameSpecifier.cpp (+1) 
- (modified) clang/lib/AST/ODRHash.cpp (+1-1) 
- (modified) clang/lib/AST/QualTypeNames.cpp (+4-3) 
- (modified) clang/lib/AST/Type.cpp (+30-4) 
- (modified) clang/lib/AST/TypePrinter.cpp (+2-2) 
- (modified) clang/lib/CodeGen/CGCXXABI.cpp (+1-1) 
- (modified) clang/lib/CodeGen/CGPointerAuth.cpp (+2-2) 
- (modified) clang/lib/CodeGen/CGVTables.cpp (+2-3) 
- (modified) clang/lib/CodeGen/CodeGenModule.cpp (+1-1) 
- (modified) clang/lib/CodeGen/ItaniumCXXABI.cpp (+5-5) 
- (modified) clang/lib/CodeGen/MicrosoftCXXABI.cpp (+4-3) 
- (modified) clang/lib/Sema/SemaAccess.cpp (+18-8) 
- (modified) clang/lib/Sema/SemaCast.cpp (+2-2) 
- (modified) clang/lib/Sema/SemaExpr.cpp (+4-6) 
- (modified) clang/lib/Sema/SemaExprCXX.cpp (+3-1) 
- (modified) clang/lib/Sema/SemaOpenMP.cpp (+2-3) 
- (modified) clang/lib/Sema/SemaOverload.cpp (+60-27) 
- (modified) clang/lib/Sema/SemaTemplate.cpp (+6-2) 
- (modified) clang/lib/Sema/SemaTemplateDeduction.cpp (+16-5) 
- (modified) clang/lib/Sema/SemaType.cpp (+22-100) 
- (modified) clang/lib/Sema/TreeTransform.h (+29-30) 
- (modified) clang/lib/Serialization/ASTReader.cpp (+1-1) 
- (modified) clang/lib/Serialization/ASTWriter.cpp (+1-1) 
- (modified) clang/lib/Serialization/TemplateArgumentHasher.cpp (+3-1) 
- (modified) clang/test/AST/ast-dump-template-json-win32-mangler-crash.cpp 
(+3-1) 
- (modified) clang/test/AST/ast-dump-templates.cpp (+238) 
- (modified) clang/test/AST/ast-dump-types-json.cpp (+338-44) 
- (modified) clang/test/AST/attr-print-emit.cpp (+1-1) 
- (modified) clang/test/Analysis/cxx-uninitialized-object-ptr-ref.cpp (+5-5) 
- (modified) clang/test/CXX/class.access/p6.cpp (+2-2) 
- (modified) clang/test/CXX/drs/cwg0xx.cpp (+6-6) 
- (modified) clang/test/CXX/drs/cwg13xx.cpp (+2-2) 
- (modified) clang/test/CXX/drs/cwg26xx.cpp (+3-3) 
- (modified) clang/test/CXX/drs/cwg2xx.cpp (+2-2) 
- (modified) clang/test/CXX/drs/cwg4xx.cpp (+1-1) 
- (modified) clang/test/CXX/drs/cwg7xx.cpp (+1-2) 
- (modified) clang/test/CXX/temp/temp.arg/temp.arg.nontype/p1.cpp (+1-1) 
- (modified) clang/test/CXX/temp/temp.arg/temp.arg.nontype/p5.cpp (+3-3) 
- (modified) clang/test/Index/print-type.cpp (+1-1) 
- (modified) clang/test/SemaCXX/addr-of-overloaded-function.cpp (+13-13) 
- (modified) clang/test/SemaCXX/builtin-ptrtomember-ambig.cpp (+2-2) 
- (modified) clang/test/SemaCXX/calling-conv-compat.cpp (+21-21) 
- (modified) clang/test/SemaCXX/err_init_conversion_failed.cpp (+1-1) 
- (modified) clang/test/SemaCXX/member-pointer.cpp (+13-4) 
- (modified) clang/test/SemaOpenACC/combined-construct-if-ast.cpp (+2-2) 
- (modified) clang/test/SemaOpenACC/combined-con

[clang] [clang-tools-extra] [lldb] Reland: [clang] preserve class type sugar when taking pointer to member (PR #132401)

2025-03-26 Thread Nico Weber via cfe-commits

nico wrote:

> Thanks, this will be fixed here: #133113

That also fixes an `Assertion `!isNull() && "Cannot retrieve a NULL type 
pointer"' failed.` we started seeing after this here landed (repro: 
https://issues.chromium.org/issues/406497227#comment3)

It'd be good if we could either land that soon or revert this here until the 
follow-up is ready, to keep HEAD green. (#133113 looks kind of involved, so 
maybe reverting first is safer? You'll need:

```
% git revert 960615954e4cb3150ae4a479fa7f9d0d17035eea
% git revert 5999be0f4770e9dd0f88ee9051a37119c8f5a1e4
% git revert 45270853192db53022ccadf4767999af4fe4e332
% git revert 14f7bd63b95d0f61a6f47119ac66398ca230559a
```

to also revert the existing 3 follow-ups, else you'll get conflicts.)

https://github.com/llvm/llvm-project/pull/132401
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [lldb] Reland: [clang] preserve class type sugar when taking pointer to member (PR #132401)

2025-03-26 Thread Matheus Izvekov via cfe-commits

mizvekov wrote:

Thanks, this will be fixed here: 
https://github.com/llvm/llvm-project/pull/133113

https://github.com/llvm/llvm-project/pull/132401
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [lldb] Reland: [clang] preserve class type sugar when taking pointer to member (PR #132401)

2025-03-24 Thread Matheus Izvekov via cfe-commits

mizvekov wrote:

Thanks, that would be appreciated.

https://github.com/llvm/llvm-project/pull/132401
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [lldb] Reland: [clang] preserve class type sugar when taking pointer to member (PR #132401)

2025-03-23 Thread Martin Storsjö via cfe-commits

mstorsjo wrote:

> Thanks, for the report, will be fixed by #132551

Thanks for the quick fix, I can confirm that Qt builds fine for me again!

https://github.com/llvm/llvm-project/pull/132401
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [lldb] Reland: [clang] preserve class type sugar when taking pointer to member (PR #132401)

2025-03-22 Thread Matheus Izvekov via cfe-commits

mizvekov wrote:

Thanks, for the report, will be fixed by 
https://github.com/llvm/llvm-project/pull/132551

https://github.com/llvm/llvm-project/pull/132401
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [lldb] Reland: [clang] preserve class type sugar when taking pointer to member (PR #132401)

2025-03-22 Thread Martin Storsjö via cfe-commits

mstorsjo wrote:

This change broke building Qt (tested with 6.8), ending up with errors like 
this:

```
qtbase/src/corelib/kernel/qcoreapplication.cpp:2946:78: error: 'this' cannot be 
used in a static member function declaration
 2946 | : slotObject(std::move(slotObject)), context(context ? 
context : this)
  | 
 ^
qtbase/src/corelib/kernel/qobjectdefs_impl.h:405:23: note: in instantiation of 
template class 'QtPrivate::CallableHelper' requested here
  405 | struct Callable : CallableHelper::Type
  |   ^
qtbase/src/corelib/kernel/qobjectdefs.h:437:38: note: in instantiation of 
template class 'QtPrivate::Callable' requested here
  437 |  typename QtPrivate::Callable::ReturnType *ret)
  |  ^
qtbase/src/corelib/kernel/qcoreapplication.cpp:2980:13: note: while 
substituting deduced template arguments into function template 'invokeMethod' 
[with Func = void (PermissionReceiver::*)(const QPermission &)]
 2980 | QMetaObject::invokeMethod(receiver,
  | ^
```

This issue also persists on the latest git main as of right now.

I've reduced the issue down to the following small reproducer:
```c++
template  struct CallableHelper {
  static auto Resolve() -> Func;
};
struct QIODevice {
  void d_func() { d_ptr; }
  int d_ptr;
};
struct Callable : CallableHelper {};
```
Reproducible with e.g. `clang -target x86_64-linux-gnu -c repro.cpp` 
(presumably the same way for any target).

https://github.com/llvm/llvm-project/pull/132401
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [lldb] Reland: [clang] preserve class type sugar when taking pointer to member (PR #132401)

2025-03-21 Thread Matheus Izvekov via cfe-commits

https://github.com/mizvekov closed 
https://github.com/llvm/llvm-project/pull/132401
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [lldb] Reland: [clang] preserve class type sugar when taking pointer to member (PR #132401)

2025-03-21 Thread Michael Buch via cfe-commits

https://github.com/Michael137 commented:

LLDB changes LGTM

https://github.com/llvm/llvm-project/pull/132401
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits