Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[clang] Add the check of membership for the issue #58674 and improve …
…the lookup process This patch includes the commit 01adf96 and a fix of unhandled declaration references. When looking up base classes, Clang first checks whether a base class is a template and takes the specialized template based on it. However, the base class might be instantiated, and the above behavior can lose information. This patch fixes the problem by first checking whether a base class is a record declaration, so the instantiated one will be taken. Differential Revision: https://reviews.llvm.org/D143840
- Loading branch information
Showing
6 changed files
with
116 additions
and
30 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
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
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,22 @@ | ||
// RUN: %clang_cc1 -triple=x86_64-unknown-linux -emit-llvm %s -o - | FileCheck %s | ||
|
||
// CHECK: [[FOO:%.+]] = type { i32 } | ||
struct foo { | ||
int val; | ||
}; | ||
|
||
template <typename T> struct bar : T { | ||
}; | ||
|
||
struct baz : bar<foo> { | ||
// CHECK-LABEL: define{{.*}} i32 @_ZN3baz3getEv | ||
// CHECK: {{%.+}} = getelementptr inbounds [[FOO]], ptr {{%.+}}, i32 0, i32 0 | ||
int get() { | ||
return val; | ||
} | ||
}; | ||
|
||
int qux() { | ||
auto f = baz{}; | ||
return f.get(); | ||
} |
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