diff options
Diffstat (limited to 'clang/lib/Sema/SemaStmt.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaStmt.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaStmt.cpp b/clang/lib/Sema/SemaStmt.cpp index 6bdc71bb891..1b6aed61933 100644 --- a/clang/lib/Sema/SemaStmt.cpp +++ b/clang/lib/Sema/SemaStmt.cpp @@ -753,6 +753,12 @@ static void checkEnumTypesInSwitchStmt(Sema &S, const Expr *Cond, if (!CondEnumType || !CaseEnumType) return; + // Ignore anonymous enums. + if (!CondEnumType->getDecl()->getIdentifier()) + return; + if (!CaseEnumType->getDecl()->getIdentifier()) + return; + if (S.Context.hasSameUnqualifiedType(CondType, CaseType)) return; |

