aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaType.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-02-27 18:53:28 +0000
committerChris Lattner <sabre@nondot.org>2009-02-27 18:53:28 +0000
commit35d276f443462249b436951c1c663820569e1768 (patch)
tree5d1d33f6b2cd5d888a53bab6bca480db1a370762 /lib/Sema/SemaType.cpp
parente64c5491d0097b280eb553696ee9c0d8fa139f82 (diff)
upgrade various 'implicit int' warnings from an ext-warn to warning when not
in C89 mode. This makes it enabled by default instead of only enabled with -pedantic. Clang defaults to c99 mode, so people will see this more often than with GCC, but they can always use -std=c89 if they really want c89. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65647 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaType.cpp')
-rw-r--r--lib/Sema/SemaType.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp
index d1dcca6cf1..bfbf8ab952 100644
--- a/lib/Sema/SemaType.cpp
+++ b/lib/Sema/SemaType.cpp
@@ -74,10 +74,10 @@ QualType Sema::ConvertDeclSpecToType(const DeclSpec &DS) {
// parser already though by it pretending to have seen an 'int' in this
// case.
if (getLangOptions().ImplicitInt) {
- if ((DS.getParsedSpecifiers() & (DeclSpec::PQ_StorageClassSpecifier |
- DeclSpec::PQ_TypeSpecifier |
- DeclSpec::PQ_TypeQualifier)) == 0)
- Diag(DS.getSourceRange().getBegin(), diag::ext_missing_declspec);
+ // In C89 mode, we only warn if there is a completely missing declspec
+ // when one is not allowed.
+ if (DS.isEmpty())
+ Diag(DS.getSourceRange().getBegin(), diag::warn_missing_declspec);
} else if (!DS.hasTypeSpecifier()) {
// C99 and C++ require a type specifier. For example, C99 6.7.2p2 says:
// "At least one type specifier shall be given in the declaration
@@ -86,7 +86,7 @@ QualType Sema::ConvertDeclSpecToType(const DeclSpec &DS) {
// FIXME: Does Microsoft really have the implicit int extension in C++?
unsigned DK = getLangOptions().CPlusPlus && !getLangOptions().Microsoft?
diag::err_missing_type_specifier
- : diag::ext_missing_type_specifier;
+ : diag::warn_missing_type_specifier;
Diag(DS.getSourceRange().getBegin(), DK);
}