llvm-project/clang/lib/Sema
Hans Wennborg 8f62c5ca22 Better diagnostics for string initialization.
This commit improves Clang's diagnostics for string initialization.
Where it would previously say:

  /tmp/a.c:3:9: error: array initializer must be an initializer list
  wchar_t s[] = "Hi";
          ^
  /tmp/a.c:4:6: error: array initializer must be an initializer list or string literal
  char t[] = L"Hi";
       ^

It will now say

  /tmp/a.c:3:9: error: initializing wide char array with non-wide string literal
  wchar_t s[] = "Hi";
          ^
  /tmp/a.c:4:6: error: initializing char array with wide string literal
  char t[] = L"Hi";
       ^

As a bonus, it also fixes the fact that Clang would previously reject
this valid C11 code:

  char16_t s[] = u"hi";
  char32_t t[] = U"hi";

because it would only recognize the built-in types for char16_t and
char32_t, which do not exist in C.

llvm-svn: 181880
2013-05-15 11:03:04 +00:00
..
AnalysisBasedWarnings.cpp Thread safety analysis: turn on checking within lock and unlock functions. 2013-04-08 20:11:11 +00:00
AttributeList.cpp Basic support for Microsoft property declarations and 2013-04-16 07:28:30 +00:00
CMakeLists.txt OpenMP threadprivate directive parsing and semantic analysis 2013-03-22 06:34:35 +00:00
CodeCompleteConsumer.cpp Allow the computation of the base priority for a declaration code completion result to consider the completion context 2013-01-31 04:52:16 +00:00
DeclSpec.cpp Don't mark a type specifier as "owned" if there is no declaration to own. 2013-05-14 23:22:32 +00:00
DelayedDiagnostic.cpp objective-C: when diagnosing deprecated/unavailable usage of 2012-09-21 20:46:37 +00:00
IdentifierResolver.cpp [Modules] Cope better with top-level declarations loaded after being declared in the current translation unit <rdar://problem/13189985>. 2013-02-11 18:16:18 +00:00
JumpDiagnostics.cpp s/CPlusPlus0x/CPlusPlus11/g 2013-01-02 11:42:31 +00:00
Makefile
MultiplexExternalSemaSource.cpp Simplify FindExternalVisibleDeclsByName by making it return a bool indicating 2013-02-07 03:30:24 +00:00
Scope.cpp Reapply r151638 and r151641. 2012-02-29 10:24:19 +00:00
ScopeInfo.cpp Sema for Captured Statements 2013-04-16 19:37:38 +00:00
Sema.cpp Cleanup handling of UniqueExternalLinkage. 2013-05-13 00:12:11 +00:00
SemaAccess.cpp Test commit 2013-05-07 16:56:03 +00:00
SemaAttr.cpp Forward #pragma comment(lib/linker) through as flags metadata 2013-05-08 13:44:39 +00:00
SemaCXXScopeSpec.cpp Remove some no-op static_casts. 2013-03-26 00:54:11 +00:00
SemaCast.cpp Grab-bag of bit-field fixes: 2013-05-06 21:39:12 +00:00
SemaChecking.cpp Grab-bag of bit-field fixes: 2013-05-06 21:39:12 +00:00
SemaCodeComplete.cpp Enhance the ObjC global method pool to record whether there were 0, 1, or >= 2 methods (with a particular selector) inside categories. 2013-04-17 00:08:58 +00:00
SemaConsumer.cpp Unweaken vtables as per http://llvm.org/docs/CodingStandards.html#ll_virtual_anch 2011-12-20 02:48:34 +00:00
SemaDecl.cpp Cleanup handling of UniqueExternalLinkage. 2013-05-13 00:12:11 +00:00
SemaDeclAttr.cpp ArrayRef'ize InitializationSequence constructor and InitializationSequence::Diagnose() 2013-05-03 15:05:50 +00:00
SemaDeclCXX.cpp Use only explicit bool conversion operator 2013-05-15 07:37:26 +00:00
SemaDeclObjC.cpp Use only explicit bool conversion operator 2013-05-15 07:37:26 +00:00
SemaExceptionSpec.cpp C++1y: Allow aggregates to have default initializers. 2013-04-20 22:23:05 +00:00
SemaExpr.cpp Use only explicit bool conversion operator 2013-05-15 07:37:26 +00:00
SemaExprCXX.cpp ArrayRef'ize Sema::FindAllocationFunctions 2013-05-10 13:22:23 +00:00
SemaExprMember.cpp When typo correction produces an overloaded result when looking up a member, 2013-05-07 22:14:37 +00:00
SemaExprObjC.cpp Objective-C [diagnostics] [QOI], when method is not 2013-05-14 23:24:17 +00:00
SemaFixItUtils.cpp s/CPlusPlus0x/CPlusPlus11/g 2013-01-02 11:42:31 +00:00
SemaInit.cpp Better diagnostics for string initialization. 2013-05-15 11:03:04 +00:00
SemaLambda.cpp C++1y n3648: parse and reject init-captures for now. 2013-05-09 21:36:41 +00:00
SemaLookup.cpp Provide operator<< for stream output of DeclarationNames 2013-05-14 21:04:00 +00:00
SemaObjCProperty.cpp Replace ArrayRef<T>() with None, now that we have an implicit ArrayRef constructor from None 2013-05-05 00:41:58 +00:00
SemaOpenMP.cpp OpenMP threadprivate with qualified names. 2013-05-13 04:18:18 +00:00
SemaOverload.cpp PR15966: don't get confused by a complex integer -> complex integer conversion 2013-05-10 20:29:50 +00:00
SemaPseudoObject.cpp Replace 'MultiExprArg()' with 'None' 2013-05-05 20:40:26 +00:00
SemaStmt.cpp C++1y: provide full 'auto' return type deduction for lambda expressions. This 2013-05-12 03:09:35 +00:00
SemaStmtAsm.cpp Remove redundant variable 2013-05-10 01:14:26 +00:00
SemaStmtAttr.cpp PR15300: Support C++11 attributes on base-specifiers. We don't support any such 2013-02-19 23:47:15 +00:00
SemaTemplate.cpp Cleanup handling of UniqueExternalLinkage. 2013-05-13 00:12:11 +00:00
SemaTemplateDeduction.cpp Implement most of N3638 (return type deduction for normal functions). 2013-05-04 07:00:32 +00:00
SemaTemplateInstantiate.cpp Add support for __wchar_t in -fms-extensions mode. 2013-05-10 10:08:40 +00:00
SemaTemplateInstantiateDecl.cpp OpenMP threadprivate with qualified names. 2013-05-13 04:18:18 +00:00
SemaTemplateVariadic.cpp Implement C++1y decltype(auto). 2013-04-26 16:15:35 +00:00
SemaType.cpp Implement most of N3638 (return type deduction for normal functions). 2013-05-04 07:00:32 +00:00
TargetAttributesSema.cpp PR14922: when printing an attribute, use the real syntax of the attribute (GNU, C++11, MS Declspec) instead of hardcoded GNU syntax. 2013-01-24 16:46:58 +00:00
TargetAttributesSema.h Revert r170500. It over-zealously converted *ALL* things named Attributes, which is wrong here. 2012-12-20 19:22:21 +00:00
TreeTransform.h ArrayRef'ize GenericSelectionExpr 2013-05-10 13:06:58 +00:00
TypeLocBuilder.h Replace TypeLoc llvm::cast support to be well-defined. 2013-02-18 22:06:02 +00:00