mizvekov wrote:
The test case provided shows a bug in the original implementation of the
analyzer anyway.
Here is the clang output for the slightly reduced repro:
```C++
struct A {
static A a;
char b;
friend bool operator==(A, A) = default;
};
bool _ = A() == A::a;
```
Original clang out
gribozavr wrote:
I reverted this PR in
https://github.com/llvm/llvm-project/commit/e38f4f6904b774dfdd90d78c3fb282f8cc9d07c1.
https://github.com/llvm/llvm-project/pull/124605
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.or
erichkeane wrote:
> f == b::c;
> }
> $ clang "-cc1" "-triple" "x86_64-grtev4-linux-gnu" "-std=gnu++20" "-x"
> "c++" -analyze -analyzer-checker=debug.DumpCFG parser_test-42bc8e.cpp
> parser_test-42bc8e.cpp:10:5: warning: equality comparison result unused
> [-Wunused-comparison]
>10 | f
@@ -1257,28 +1257,42 @@ void StmtPrinter::VisitConstantExpr(ConstantExpr *Node)
{
}
void StmtPrinter::VisitDeclRefExpr(DeclRefExpr *Node) {
- if (const auto *OCED = dyn_cast(Node->getDecl())) {
+ ValueDecl *VD = Node->getDecl();
+ if (const auto *OCED = dyn_cast(VD)) {
gribozavr wrote:
@mizvekov It looks like this PR introduces a crash, I'm going to revert it.
Here is a reproducer:
```
$ cat parser_test-42bc8e.cpp
enum a : char;
class b {
public:
static b c;
friend bool operator==(b, b) = default;
a d;
};
void e() {
b f;
f == b::c;
}
$ clang "-cc1"
https://github.com/cor3ntin approved this pull request.
https://github.com/llvm/llvm-project/pull/124605
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/erichkeane approved this pull request.
https://github.com/llvm/llvm-project/pull/124605
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -875,7 +875,41 @@ void TextNodeDumper::dumpBareDeclRef(const Decl *D) {
if (const NamedDecl *ND = dyn_cast(D)) {
ColorScope Color(OS, ShowColors, DeclNameColor);
-OS << " '" << ND->getDeclName() << '\'';
+if (DeclarationName Name = ND->getDeclName())
+ OS
https://github.com/mizvekov updated
https://github.com/llvm/llvm-project/pull/124605
>From cf6413e220574adac3c89b28cc5011050ce11144 Mon Sep 17 00:00:00 2001
From: Matheus Izvekov
Date: Mon, 27 Jan 2025 15:08:01 -0300
Subject: [PATCH 1/2] NFC: convert
clang/test/AST/HLSL/StructuredBuffers-AST.h
@@ -875,7 +875,41 @@ void TextNodeDumper::dumpBareDeclRef(const Decl *D) {
if (const NamedDecl *ND = dyn_cast(D)) {
ColorScope Color(OS, ShowColors, DeclNameColor);
-OS << " '" << ND->getDeclName() << '\'';
+if (DeclarationName Name = ND->getDeclName())
+ OS
@@ -875,7 +875,41 @@ void TextNodeDumper::dumpBareDeclRef(const Decl *D) {
if (const NamedDecl *ND = dyn_cast(D)) {
ColorScope Color(OS, ShowColors, DeclNameColor);
-OS << " '" << ND->getDeclName() << '\'';
+if (DeclarationName Name = ND->getDeclName())
+ OS
@@ -875,7 +875,41 @@ void TextNodeDumper::dumpBareDeclRef(const Decl *D) {
if (const NamedDecl *ND = dyn_cast(D)) {
ColorScope Color(OS, ShowColors, DeclNameColor);
-OS << " '" << ND->getDeclName() << '\'';
+if (DeclarationName Name = ND->getDeclName())
+ OS
@@ -875,7 +875,41 @@ void TextNodeDumper::dumpBareDeclRef(const Decl *D) {
if (const NamedDecl *ND = dyn_cast(D)) {
ColorScope Color(OS, ShowColors, DeclNameColor);
-OS << " '" << ND->getDeclName() << '\'';
+if (DeclarationName Name = ND->getDeclName())
+ OS
llvmbot wrote:
@llvm/pr-subscribers-clang-modules
@llvm/pr-subscribers-hlsl
Author: Matheus Izvekov (mizvekov)
Changes
ast-print: A DeclRef to an anonymous NTTP will print
'value-parameter--',
similar to how type parameters are printed.
ast-dump: A bareDeclRef to an anonymo
https://github.com/mizvekov edited
https://github.com/llvm/llvm-project/pull/124605
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/mizvekov created
https://github.com/llvm/llvm-project/pull/124605
ast-print: A DeclRef to an anonymous NTTP will print
'value-parameter--',
similar to how type parameters are printed.
ast-dump: A bareDeclRef to an anonymous entity will print some extra
identifying informati
16 matches
Mail list logo