Commit e1cb316
authored
Reapply "[clang] Fix name lookup for dependent bases" (llvm#118003)
Unlike the previous version
(llvm#114978), this patch also
removes an unnecessary assert that causes Clang to crash when compiling
such tests. (clang/lib/AST/DeclCXX.cpp)
https://lab.llvm.org/buildbot/#/builders/52/builds/4021
```c++
template <class T>
class X {
public:
X() = default;
virtual ~X() = default;
virtual int foo(int x, int y, T &entry) = 0;
void bar() {
struct Y : public X<T> {
Y() : X() {}
int foo(int, int, T &) override {
return 42;
}
};
}
};
```
the assertions:
```c++
llvm-project/clang/lib/AST/DeclCXX.cpp:2508: void clang::CXXMethodDecl::addOverriddenMethod(const CXXMethodDecl *): Assertion `!MD->getParent()->isDependentContext() && "Can't add an overridden method to a class template!"' failed.
```
I believe that this assert is unnecessary and contradicts the logic of
this patch. After its removal, Clang was successfully built using
itself, and all tests passed.1 parent 2a0ee09 commit e1cb316
File tree
5 files changed
+62
-11
lines changed- clang
- docs
- lib/AST
- test/CXX/drs
- www
5 files changed
+62
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
310 | 310 | | |
311 | 311 | | |
312 | 312 | | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
313 | 316 | | |
314 | 317 | | |
315 | 318 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
137 | | - | |
| 137 | + | |
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
| |||
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
172 | 179 | | |
173 | 180 | | |
174 | 181 | | |
175 | 182 | | |
176 | 183 | | |
177 | 184 | | |
178 | | - | |
| 185 | + | |
| 186 | + | |
179 | 187 | | |
180 | 188 | | |
181 | 189 | | |
| |||
243 | 251 | | |
244 | 252 | | |
245 | 253 | | |
246 | | - | |
| 254 | + | |
247 | 255 | | |
248 | | - | |
249 | 256 | | |
250 | 257 | | |
251 | 258 | | |
| |||
264 | 271 | | |
265 | 272 | | |
266 | 273 | | |
267 | | - | |
268 | | - | |
| 274 | + | |
269 | 275 | | |
270 | 276 | | |
271 | 277 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2602 | 2602 | | |
2603 | 2603 | | |
2604 | 2604 | | |
2605 | | - | |
2606 | | - | |
2607 | 2605 | | |
2608 | 2606 | | |
2609 | 2607 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1178 | 1178 | | |
1179 | 1179 | | |
1180 | 1180 | | |
1181 | | - | |
| 1181 | + | |
1182 | 1182 | | |
1183 | 1183 | | |
1184 | 1184 | | |
1185 | 1185 | | |
1186 | 1186 | | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
| 1204 | + | |
| 1205 | + | |
| 1206 | + | |
| 1207 | + | |
| 1208 | + | |
1187 | 1209 | | |
1188 | 1210 | | |
1189 | 1211 | | |
1190 | 1212 | | |
1191 | | - | |
| 1213 | + | |
| 1214 | + | |
| 1215 | + | |
| 1216 | + | |
| 1217 | + | |
| 1218 | + | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
1192 | 1236 | | |
1193 | 1237 | | |
1194 | 1238 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3599 | 3599 | | |
3600 | 3600 | | |
3601 | 3601 | | |
3602 | | - | |
| 3602 | + | |
3603 | 3603 | | |
3604 | 3604 | | |
3605 | 3605 | | |
| |||
0 commit comments