forked from OSchip/llvm-project
Fix for PR6220: compute the correct type for multicharacter literals.
llvm-svn: 95228
This commit is contained in:
parent
e3ee332fe0
commit
eb1df70bdc
|
@ -1668,6 +1668,8 @@ Sema::OwningExprResult Sema::ActOnCharacterConstant(const Token &Tok) {
|
|||
Ty = Context.IntTy; // 'x' and L'x' -> int in C.
|
||||
else if (Literal.isWide())
|
||||
Ty = Context.WCharTy; // L'x' -> wchar_t in C++.
|
||||
else if (Literal.isMultiChar())
|
||||
Ty = Context.IntTy; // 'wxyz' -> int in C++.
|
||||
else
|
||||
Ty = Context.CharTy; // 'x' -> char in C++
|
||||
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
||||
|
||||
// Check types of char literals
|
||||
extern char a;
|
||||
extern __typeof('a') a;
|
||||
extern int b;
|
||||
extern __typeof('asdf') b;
|
||||
extern wchar_t c;
|
||||
extern __typeof(L'a') c;
|
Loading…
Reference in New Issue