-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[clang][DeclPrinter] Fix AST print of delegating constructors
DeclPrinter::PrintConstructorInitializers did not consider delegating initializers. As result, the output contained an "NULL TYPE" for delegating constructors. Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D154186
- Loading branch information
Showing
2 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// RUN: %clang_cc1 -ast-print %s -o - -std=c++20 | FileCheck %s | ||
|
||
// CHECK: struct A { | ||
struct A { | ||
// CHECK-NEXT: A(); | ||
A(); | ||
|
||
// CHECK-NEXT: A(int) : A() { | ||
A(int) : A() { | ||
// CHECK-NEXT: } | ||
} | ||
|
||
// CHECK-NEXT: }; | ||
}; | ||
|
||
|
||
// CHECK: struct B { | ||
struct B { | ||
// CHECK-NEXT: template <typename Ty> B(Ty); | ||
template <typename Ty> B(Ty); | ||
|
||
// FIXME: Implicitly specialized method should not be output | ||
// CHECK-NEXT: template<> B<float>(float); | ||
|
||
// CHECK-NEXT: B(int X) : B((float)X) { | ||
B(int X) : B((float)X) { | ||
// CHECK-NEXT: } | ||
} | ||
|
||
// CHECK-NEXT: }; | ||
}; | ||
|
||
// CHECK: struct C { | ||
struct C { | ||
// FIXME: template <> should not be output | ||
// CHECK: template <> C(auto); | ||
C(auto); | ||
|
||
// FIXME: Implicitly specialized method should not be output | ||
// CHECK: template<> C<const char *>(const char *); | ||
|
||
// CHECK: C(int) : C("") { | ||
C(int) : C("") { | ||
// CHECK-NEXT: } | ||
} | ||
|
||
// CHECK-NEXT: }; | ||
}; |