To do this, thread DiagnosticErrorTrap's hasUnrecoverableErrorOccurred through
to Scope.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178294
91177308-0d34-0410-b5e6-
96231b3b80d8
void setEntity(void *E) { Entity = E; }
bool hasErrorOccurred() const { return ErrorTrap.hasErrorOccurred(); }
-
+
+ bool hasUnrecoverableErrorOccurred() const {
+ return ErrorTrap.hasUnrecoverableErrorOccurred();
+ }
+
/// isClassScope - Return true if this scope is a class/struct/union scope.
bool isClassScope() const {
return (getFlags() & Scope::ClassScope);
if (!D->getDeclName()) continue;
// Diagnose unused variables in this scope.
- if (!S->hasErrorOccurred())
+ if (!S->hasUnrecoverableErrorOccurred())
DiagnoseUnusedDecl(D);
// If this was a forward reference to a label, verify it was defined.
--- /dev/null
+// RUN: %clang_cc1 -fsyntax-only -Wunused-variable -Werror -verify %s
+
+void f() {
+ int i; // expected-error{{unused}}
+ int j; // expected-error{{unused}}
+}