llvm/clang/lib/Sema
Zhihao Yuan 44eee659f1
[AST] Print NTTP args as string-literals when possible
C++20 non-type template parameter prints `MyType<{{116, 104, 105, 115}}>` when the code is as simple as `MyType<"this">`. This patch prints `MyType<{"this"}>`, with one layer of braces preserved for the intermediate structural type to trigger CTAD.

`StringLiteral` handles this case, but `StringLiteral` inside `APValue` code looks like a circular dependency. The proposed patch implements a cheap strategy to emit string literals in diagnostic messages only when they are readable and fall back to integer sequences.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D115031
2022-03-01 19:34:27 -06:00
..
AnalysisBasedWarnings.cpp
CMakeLists.txt
CodeCompleteConsumer.cpp
CoroutineStmtBuilder.h
DeclSpec.cpp
DelayedDiagnostic.cpp
IdentifierResolver.cpp
JumpDiagnostics.cpp
MultiplexExternalSemaSource.cpp
OpenCLBuiltins.td [OpenCL] Align subgroup builtin guards 2022-02-23 12:22:09 +00:00
ParsedAttr.cpp Allow parameter pack expansions and initializer lists in annotate attribute 2022-02-08 13:38:07 -05:00
Scope.cpp
ScopeInfo.cpp
Sema.cpp [AST] Print NTTP args as string-literals when possible 2022-03-01 19:34:27 -06:00
SemaAccess.cpp
SemaAttr.cpp Add support for floating-point option ffp-eval-method and for 2022-02-23 15:00:18 -08:00
SemaAvailability.cpp
SemaCast.cpp [clang][sema] TryStaticCast - use castAs<> instead of getAs<> to avoid dereference of nullptr 2022-02-12 11:14:19 +00:00
SemaChecking.cpp [PowerPC] Fix __builtin_pdepd and __builtin_pextd to be 64-bit and P10 only. 2022-02-15 12:30:50 -06:00
SemaCodeComplete.cpp [clang][sema] - remove CodeCompleter nullptr checks 2022-02-11 15:09:44 +00:00
SemaConcept.cpp
SemaConsumer.cpp
SemaCoroutine.cpp [C++20] [Coroutines] Implement return value optimization for get_return_object 2022-02-16 13:38:00 +08:00
SemaCUDA.cpp [CUDA][HIP] Do not promote constexpr var with non-constant initializer 2022-02-15 15:15:55 -05:00
SemaCXXScopeSpec.cpp
SemaDecl.cpp [clang] Remove unused variable AllElementsInt. 2022-02-28 12:27:34 -05:00
SemaDeclAttr.cpp Update the diagnostic behavior of [[noreturn]] in C2x 2022-02-14 14:04:32 -05:00
SemaDeclCXX.cpp
SemaDeclObjC.cpp
SemaExceptionSpec.cpp [clang] Sema::CheckEquivalentExceptionSpec - remove useless nullptr test 2022-02-17 16:59:50 +00:00
SemaExpr.cpp [clang] MarkVarDeclODRUsed - remove redundant nullptr check. NFCI. 2022-02-26 21:24:26 +00:00
SemaExprCXX.cpp [c++2b] Implement P0849R8 auto(x) 2022-02-28 19:21:08 -06:00
SemaExprMember.cpp
SemaExprObjC.cpp
SemaFixItUtils.cpp
SemaInit.cpp
SemaLambda.cpp
SemaLookup.cpp [C++20][Modules][8/8] Amend module visibility rules for partitions. 2022-03-01 08:29:05 +00:00
SemaModule.cpp [C++20][Modules][7/8] Find the primary interface name for a module. 2022-02-28 08:50:25 +00:00
SemaObjCProperty.cpp
SemaOpenMP.cpp [OpenMP] Add option to make offloading mandatory 2022-02-23 16:45:36 -05:00
SemaOverload.cpp
SemaPseudoObject.cpp
SemaStmt.cpp [clang] Don't emit redundant warnings for 'return;' 2022-02-14 11:28:32 -05:00
SemaStmtAsm.cpp
SemaStmtAttr.cpp [Clang] noinline call site attribute 2022-02-28 21:21:17 +01:00
SemaSYCL.cpp
SemaTemplate.cpp [clang][sema] ActOnExplicitInstantiation - remove Prev nullptr check 2022-02-11 15:09:44 +00:00
SemaTemplateDeduction.cpp Fix Wdocumentation unknown parameter warning 2022-02-18 17:27:45 +00:00
SemaTemplateInstantiate.cpp [NFC] Make 1st param to getTemplateInstantiationArgs const correct 2022-02-28 12:14:14 -08:00
SemaTemplateInstantiateDecl.cpp [NFC]Promote addInstantiatedParametersToScope to a private Sema function 2022-03-01 08:31:51 -08:00
SemaTemplateVariadic.cpp
SemaType.cpp [c++2b] Implement P0849R8 auto(x) 2022-02-28 19:21:08 -06:00
TreeTransform.h [clang] Never wrap a nullptr in CXXNewExpr::getArraySize() 2022-02-22 16:27:32 +01:00
TypeLocBuilder.cpp
TypeLocBuilder.h
UsedDeclVisitor.h