notice because it was a negative test with a fix suggested by
Jean-Daniel Dupas. Convert the test from a negative to a positive
test to catch stuff like this.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65708
91177308-0d34-0410-b5e6-
96231b3b80d8
else
Diag(IdLoc, diag::err_redefinition) << Id;
Diag(PrevDecl->getLocation(), diag::note_previous_definition);
- Val->Destroy(Context);
+ if (Val) Val->Destroy(Context);
return 0;
}
}
-// RUN: not clang %s -std=c90 &&
+// RUN: clang %s -std=c90 -verify &&
// RUN: clang %s -std=c99
int f (int z) {
- if (z + sizeof (enum {a}))
- return 1 + sizeof (enum {a});
+ if (z + sizeof (enum {a})) // expected-note {{previous definition is here}}
+ return 1 + sizeof (enum {a}); // expected-error {{redefinition of enumerator 'a'}}
return 0;
}