
Summary: After we parse the switch condition, we don't do the type check for type-dependent expr (e.g. TypoExpr) (in Sema::CheckSwitchCondition), then the TypoExpr is corrected to an invalid-type expr (in Sema::MakeFullExpr) and passed to the ActOnStartOfSwitchStmt, which triggers the assertion. Fix https://github.com/clangd/clangd/issues/311 Reviewers: sammccall Subscribers: ilya-biryukov, kadircet, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D76592
10 lines
283 B
C++
10 lines
283 B
C++
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
|
|
|
namespace c { double xxx; } // expected-note{{'c::xxx' declared here}}
|
|
namespace d { float xxx; }
|
|
namespace z { namespace xxx {} }
|
|
|
|
void crash() {
|
|
switch (xxx) {} // expected-error{{use of undeclared identifier 'xxx'; did you mean }}
|
|
}
|