#include "clang/AST/Decl.h"
#include "clang/Parse/DeclSpec.h"
#include "clang/Lex/IdentifierTable.h"
+#include "clang/Basic/LangOptions.h"
using namespace clang;
/// ConvertDeclSpecToType - Convert the specified declspec to the appropriate
/// GetTypeForDeclarator - Convert the type for the specified declarator to Type
/// instances.
QualType Sema::GetTypeForDeclarator(Declarator &D, Scope *S) {
+ // long long is a C99 feature.
+ if (!getLangOptions().C99 &&
+ D.getDeclSpec().getTypeSpecWidth() == DeclSpec::TSW_longlong)
+ Diag(D.getDeclSpec().getTypeSpecWidthLoc(), diag::ext_longlong);
+
QualType T = ConvertDeclSpecToType(D.getDeclSpec(), Context);
// Apply const/volatile/restrict qualifiers to T.
"'long %0' is invalid")
DIAG(err_invalid_longlong_spec, ERROR,
"'long long %0' is invalid")
+DIAG(ext_longlong, EXTENSION,
+ "'long long' is an extension when C99 mode is not enabled")
DIAG(err_invalid_complex_spec, ERROR,
"'_Complex %0' is invalid")
DIAG(err_invalid_thread_spec, ERROR,