diff options
Diffstat (limited to 'clang')
| -rw-r--r-- | clang/lib/StaticAnalyzer/Core/ExprEngine.cpp | 2 | ||||
| -rw-r--r-- | clang/test/Analysis/cxx11-crashes.cpp | 10 | 
2 files changed, 10 insertions, 2 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp b/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp index db32003e7bf..59c66b83c73 100644 --- a/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp +++ b/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp @@ -652,7 +652,6 @@ void ExprEngine::Visit(const Stmt *S, ExplodedNode *Pred,      case Stmt::IfStmtClass:      case Stmt::IndirectGotoStmtClass:      case Stmt::LabelStmtClass: -    case Stmt::AttributedStmtClass:      case Stmt::NoStmtClass:      case Stmt::NullStmtClass:      case Stmt::SwitchStmtClass: @@ -709,6 +708,7 @@ void ExprEngine::Visit(const Stmt *S, ExplodedNode *Pred,      // Cases we intentionally don't evaluate, since they don't need      // to be explicitly evaluated.      case Stmt::AddrLabelExprClass: +    case Stmt::AttributedStmtClass:      case Stmt::IntegerLiteralClass:      case Stmt::CharacterLiteralClass:      case Stmt::ImplicitValueInitExprClass: diff --git a/clang/test/Analysis/cxx11-crashes.cpp b/clang/test/Analysis/cxx11-crashes.cpp index a2b70db2f87..3c33de33558 100644 --- a/clang/test/Analysis/cxx11-crashes.cpp +++ b/clang/test/Analysis/cxx11-crashes.cpp @@ -85,4 +85,12 @@ class SocketWireProtocolStream : public JSONWireProtocolInputStream {  void test() {    SocketWireProtocolStream stream{};    JSONWireProtocolReader reader{stream}; -}
\ No newline at end of file +} + +// This crashed because the analyzer did not understand AttributedStmts. +void fallthrough() { +  switch (1) { +    case 1: +      [[clang::fallthrough]]; +  } +}  | 

