[cfe-commits] r39367 - in /cfe/cfe/trunk: AST/SemaType.cpp Sema/SemaType.cpp include/clang/Basic/DiagnosticKinds.def
Steve Naroff
snaroff at apple.com
Wed Jul 11 09:43:40 PDT 2007
Author: snaroff
Date: Wed Jul 11 11:43:40 2007
New Revision: 39367
URL: http://llvm.org/viewvc/llvm-project?rev=39367&view=rev
Log:
Bug #:
Submitted by:
Reviewed by:
Make an error diagnosic a bit more expression (in Sema::GetTypeForDeclarator)
Modified:
cfe/cfe/trunk/AST/SemaType.cpp
cfe/cfe/trunk/Sema/SemaType.cpp
cfe/cfe/trunk/include/clang/Basic/DiagnosticKinds.def
Modified: cfe/cfe/trunk/AST/SemaType.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/AST/SemaType.cpp?rev=39367&r1=39366&r2=39367&view=diff
==============================================================================
--- cfe/cfe/trunk/AST/SemaType.cpp (original)
+++ cfe/cfe/trunk/AST/SemaType.cpp Wed Jul 11 11:43:40 2007
@@ -136,8 +136,10 @@
// C99 6.7.5.2p1: If the element type is an incomplete or function type,
// reject it (e.g. void ary[7], struct foo ary[7], void ary[7]())
if (T->isIncompleteType()) {
+ std::string Name;
+ T->getAsString(Name);
Diag(D.getIdentifierLoc(), diag::err_illegal_decl_array_incomplete_type,
- D.getIdentifier()->getName());
+ Name);
return TypeRef();
} else if (isa<FunctionType>(CanonicalT)) {
Diag(D.getIdentifierLoc(), diag::err_illegal_decl_array_of_functions,
Modified: cfe/cfe/trunk/Sema/SemaType.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Sema/SemaType.cpp?rev=39367&r1=39366&r2=39367&view=diff
==============================================================================
--- cfe/cfe/trunk/Sema/SemaType.cpp (original)
+++ cfe/cfe/trunk/Sema/SemaType.cpp Wed Jul 11 11:43:40 2007
@@ -136,8 +136,10 @@
// C99 6.7.5.2p1: If the element type is an incomplete or function type,
// reject it (e.g. void ary[7], struct foo ary[7], void ary[7]())
if (T->isIncompleteType()) {
+ std::string Name;
+ T->getAsString(Name);
Diag(D.getIdentifierLoc(), diag::err_illegal_decl_array_incomplete_type,
- D.getIdentifier()->getName());
+ Name);
return TypeRef();
} else if (isa<FunctionType>(CanonicalT)) {
Diag(D.getIdentifierLoc(), diag::err_illegal_decl_array_of_functions,
Modified: cfe/cfe/trunk/include/clang/Basic/DiagnosticKinds.def
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/include/clang/Basic/DiagnosticKinds.def?rev=39367&r1=39366&r2=39367&view=diff
==============================================================================
--- cfe/cfe/trunk/include/clang/Basic/DiagnosticKinds.def (original)
+++ cfe/cfe/trunk/include/clang/Basic/DiagnosticKinds.def Wed Jul 11 11:43:40 2007
@@ -465,7 +465,7 @@
DIAG(err_illegal_decl_array_of_functions, ERROR,
"'%s' declared as array of functions")
DIAG(err_illegal_decl_array_incomplete_type, ERROR,
- "array type for '%s' has incomplete element type")
+ "array has incomplete element type '%s'")
// Expressions.
DIAG(ext_sizeof_function_type, EXTENSION,
More information about the cfe-commits
mailing list