diff --git a/clang/lib/AST/TextNodeDumper.cpp b/clang/lib/AST/TextNodeDumper.cpp --- a/clang/lib/AST/TextNodeDumper.cpp +++ b/clang/lib/AST/TextNodeDumper.cpp @@ -1981,7 +1981,7 @@ dumpBareDeclRef(TC->getFoundDecl()); OS << ")"; } - Visit(TC->getImmediatelyDeclaredConstraint()); + AddChild([=] { Visit(TC->getImmediatelyDeclaredConstraint()); }); } else if (D->wasDeclaredWithTypename()) OS << " typename"; else diff --git a/clang/test/AST/ast-dump-concepts.cpp b/clang/test/AST/ast-dump-concepts.cpp new file mode 100644 --- /dev/null +++ b/clang/test/AST/ast-dump-concepts.cpp @@ -0,0 +1,13 @@ +// RUN: %clang_cc1 -triple x86_64-unknown-unknown -std=c++2a -ast-dump -ast-dump-filter Foo %s | FileCheck -strict-whitespace %s + +template +concept not_same_as = true; + +template +struct Foo { + // CHECK: TemplateTypeParmDecl {{.*}} referenced Concept {{.*}} 'not_same_as' + // CHECK-NEXT: |-ConceptSpecializationExpr {{.*}} 'bool' + // CHECK-NEXT: `-TemplateArgument {{.*}} type 'int' + template R> + Foo(R) requires(true); +};