diff options
author | Nico Weber <nicolasweber@gmx.de> | 2012-06-25 22:34:48 +0000 |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2012-06-25 22:34:48 +0000 |
commit | 606cef46e32cc7d7dc163c0a0f2f04b66eb580e1 (patch) | |
tree | bdb45cae96c115e00a5f84aaca7c4eeaf8173a6b /clang/lib/Sema/SemaTemplateInstantiate.cpp | |
parent | 1598289c72fb085dfc89677382a2120a4e052747 (diff) | |
download | bcm5719-llvm-606cef46e32cc7d7dc163c0a0f2f04b66eb580e1.tar.gz bcm5719-llvm-606cef46e32cc7d7dc163c0a0f2f04b66eb580e1.zip |
Give L__FUNCTION__ the right type in templates. PR13206.
llvm-svn: 159171
Diffstat (limited to 'clang/lib/Sema/SemaTemplateInstantiate.cpp')
-rw-r--r-- | clang/lib/Sema/SemaTemplateInstantiate.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaTemplateInstantiate.cpp b/clang/lib/Sema/SemaTemplateInstantiate.cpp index b26e79b135e..b80aaa2bbca 100644 --- a/clang/lib/Sema/SemaTemplateInstantiate.cpp +++ b/clang/lib/Sema/SemaTemplateInstantiate.cpp @@ -1093,7 +1093,11 @@ TemplateInstantiator::TransformPredefinedExpr(PredefinedExpr *E) { unsigned Length = PredefinedExpr::ComputeName(IT, currentDecl).length(); llvm::APInt LengthI(32, Length + 1); - QualType ResTy = getSema().Context.CharTy.withConst(); + QualType ResTy; + if (IT == PredefinedExpr::LFunction) + ResTy = getSema().Context.WCharTy.withConst(); + else + ResTy = getSema().Context.CharTy.withConst(); ResTy = getSema().Context.getConstantArrayType(ResTy, LengthI, ArrayType::Normal, 0); PredefinedExpr *PE = |