Files
clang-p2996/clang/test/CodeGenCXX/debug-info-auto-return.cpp
David Blaikie 06c70e9b99 DebugInfo: Remove auto return type representation support
Seems this complicated lldb sufficiently for some cases that it hasn't
been worth supporting/fixing there - and it so far hasn't provided any
new use cases/value for debug info consumers, so let's remove it until
someone has a use case for it.

(side note: the original implementation of this still had a bug (I
should've caught it in review) that we still didn't produce
auto-returning function declarations in types where the function wasn't
instantiatied (that requires a fix to remove the `if
getContainedAutoType` condition in
`CGDebugInfo::CollectCXXMemberFunctions` - without that, auto returning
functions were still being handled the same as member function templates
and special member functions - never added to the member list, only
attached to the type via the declaration chain from the definition)

Further discussion about this in D123319

This reverts commit 5ff992bca2: [DEBUG-INFO] Change how we handle auto return types for lambda operator() to be consistent with gcc

This reverts commit c83602fdf5: [DWARF5][clang]: Added support for DebugInfo generation for auto return type for C++ member functions.

Differential Revision: https://reviews.llvm.org/D131933
2022-08-17 00:35:05 +00:00

26 lines
964 B
C++

// Test for debug info for C++11 auto return member functions
// RUN: %clang_cc1 -dwarf-version=5 -emit-llvm -triple x86_64-linux-gnu %s -o - \
// RUN: -O0 -disable-llvm-passes \
// RUN: -debug-info-kind=standalone \
// RUN: | FileCheck --implicit-check-not="\"auto\"" --implicit-check-not=DISubprogram %s
// CHECK: !DISubprogram(name: "findMax",{{.*}}, type: [[FUN_TYPE:![0-9]+]], {{.*}}spFlags: DISPFlagDefinition, {{.*}} declaration: [[DECL:![0-9]+]]
// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "myClass",
// CHECK-SAME: elements: [[MEMBERS:![0-9]+]],
// CHECK: [[MEMBERS]] = !{}
// CHECK: [[FUN_TYPE]] = !DISubroutineType(types: [[TYPE_NODE:![0-9]+]])
// CHECK-NEXT: [[TYPE_NODE]] = !{[[DOUBLE_TYPE:![0-9]+]],
// CHECK-NEXT: [[DOUBLE_TYPE]] = !DIBasicType(name: "double",
// CHECK: [[DECL]] = !DISubprogram(name: "findMax",{{.*}}, type: [[FUN_TYPE]],
struct myClass {
auto findMax();
};
auto myClass::findMax() {
return 0.0;
}