llvm-project/clang/lib/Sema
Faisal Vali cc496a9977 Fix PR26134: When substituting into default template arguments, keep CurContext unchanged.
Or, do not set Sema's CurContext to the template declaration's when substituting into default template arguments of said template declaration.   
If we do push the template declaration context on to Sema, and the template declaration is at namespace scope, Sema can get confused and try and do odr analysis when substituting into default template arguments, even though the substitution could be occurring within a dependent context.
I'm not sure why this was being done, perhaps there was concern that if a default template argument referred to a previous template parameter, it might not be found during substitution - but all regression tests pass, and I can't craft a test that would cause it to fails (if some one does, please inform me, and i'll craft a different fix for the PR).


This patch removes a single line of code, but unfortunately adds more than it removes, because of the tests.  Some day I still hope to commit a patch that removes far more lines than it adds, while leaving clang better for it ;)

Sorry that r253590 ("Change the expression evaluation context from Unevaluated to ConstantEvaluated while substituting into non-type template argument defaults") caused the PR!

llvm-svn: 258110
2016-01-19 03:58:55 +00:00
..
AnalysisBasedWarnings.cpp [Sema] Replace pointer-to-map with a map. NFC. 2015-12-10 19:25:21 +00:00
AttributeList.cpp Roll-back r250822. 2015-10-20 13:23:58 +00:00
CMakeLists.txt [coroutines] Initial stub Sema functionality for handling coroutine await / yield / return. 2015-10-22 06:13:50 +00:00
CodeCompleteConsumer.cpp Roll-back r250822. 2015-10-20 13:23:58 +00:00
DeclSpec.cpp [OpenCL] Pipe type support 2016-01-09 12:53:17 +00:00
DelayedDiagnostic.cpp Add -Wpartial-availability. 2015-03-19 19:18:22 +00:00
IdentifierResolver.cpp [modules] Remove redundant import of lexical decls when building a lookup table 2015-03-23 03:25:59 +00:00
JumpDiagnostics.cpp Some minor ARC diagnostic improvements. 2015-10-21 18:06:38 +00:00
Makefile
MultiplexExternalSemaSource.cpp Roll-back r250822. 2015-10-20 13:23:58 +00:00
Scope.cpp MS ABI: Implement the MSVC 2015 scheme for scope disambiguation 2015-03-19 21:54:30 +00:00
ScopeInfo.cpp Properly clear current coroutine promise on FunctionScopeInfo reuse. Should 2015-10-27 07:47:45 +00:00
Sema.cpp [Sema] Make nullness warnings appear in C++. 2015-12-14 22:00:49 +00:00
SemaAccess.cpp -Wdeprecated: SavedInstanceContext is returned by value but isn't really copyable, but it can be made movable 2015-08-12 22:58:10 +00:00
SemaAttr.cpp Introduce -fsanitize-stats flag. 2016-01-16 00:31:22 +00:00
SemaCUDA.cpp [CUDA] Allow function overloads in CUDA based on host/device attributes. 2015-09-22 17:22:59 +00:00
SemaCXXScopeSpec.cpp Model NamespaceAliasDecls as having their nominated namespace as an underlying 2015-12-29 23:34:32 +00:00
SemaCast.cpp [Bugfix] Fix ICE on constexpr vector splat. 2016-01-13 01:52:39 +00:00
SemaChecking.cpp [Bugfix] Fix ICE on constexpr vector splat. 2016-01-13 01:52:39 +00:00
SemaCodeComplete.cpp Model NamespaceAliasDecls as having their nominated namespace as an underlying 2015-12-29 23:34:32 +00:00
SemaConsumer.cpp
SemaCoroutine.cpp [coroutines] Build a CoroutineBodyStmt when finishing parsing a coroutine, and form the initial_suspend, final_suspend, and get_return_object calls. 2015-11-24 02:34:39 +00:00
SemaDecl.cpp OpaquePtr: Use nullptr construction for ParsedType OpaquePtr typedef 2016-01-15 23:43:34 +00:00
SemaDeclAttr.cpp PR26111: segmentation fault with __attribute__((mode(QI))) on function declaration, by Denis Zobnin 2016-01-15 04:36:32 +00:00
SemaDeclCXX.cpp [Sema] Suppress diags in overload resolution. 2016-01-13 23:36:34 +00:00
SemaDeclObjC.cpp Split RequireCompleteType into a function that actually requires that the type 2015-12-18 22:40:25 +00:00
SemaExceptionSpec.cpp Wire a SourceLocation into IsDerivedFrom and move the RequireCompleteType call 2015-12-18 21:45:41 +00:00
SemaExpr.cpp [X86] Support 'interrupt' attribute for x86 2016-01-15 04:06:31 +00:00
SemaExprCXX.cpp OpaquePtr: Use nullptr construction for ParsedType OpaquePtr typedef 2016-01-15 23:43:34 +00:00
SemaExprMember.cpp Look through using decls when classifying implicit member access 2015-10-20 18:12:08 +00:00
SemaExprObjC.cpp OpaquePtr: Use nullptr construction for ParsedType OpaquePtr typedef 2016-01-15 23:43:34 +00:00
SemaFixItUtils.cpp Wire a SourceLocation into IsDerivedFrom and move the RequireCompleteType call 2015-12-18 21:45:41 +00:00
SemaInit.cpp Split RequireCompleteType into a function that actually requires that the type 2015-12-18 22:40:25 +00:00
SemaLambda.cpp ArrayRef-ize TemplateParameterList. NFC 2015-12-27 07:16:27 +00:00
SemaLookup.cpp Improve AST dumping: 2016-01-12 21:59:26 +00:00
SemaObjCProperty.cpp ObjC properties: consider ownership of properties from protocols when synthesizing. 2015-12-18 00:52:31 +00:00
SemaOpenMP.cpp OpaquePtr: Use nullptr construction for DeclGroupPtrTy OpaquePtr typedef 2016-01-15 23:43:25 +00:00
SemaOverload.cpp Make -Wdelete-non-virtual-dtor warn on explicit `a->~A()` dtor calls too. 2016-01-15 21:45:31 +00:00
SemaPseudoObject.cpp [MSVC] Fix for http://llvm.org/PR25636: indexed accessor property not supported correctly. 2015-12-10 04:38:18 +00:00
SemaStmt.cpp Split RequireCompleteType into a function that actually requires that the type 2015-12-18 22:40:25 +00:00
SemaStmtAsm.cpp Remove an unused parameter 2016-01-05 00:08:41 +00:00
SemaStmtAttr.cpp [Sema] Use available enum types instead of integers. As one is used in a switch, this makes the compiler ensure the switch is fully covered. NFC 2015-12-23 05:44:43 +00:00
SemaTemplate.cpp Fix PR26134: When substituting into default template arguments, keep CurContext unchanged. 2016-01-19 03:58:55 +00:00
SemaTemplateDeduction.cpp [OpenCL] Pipe type support 2016-01-09 12:53:17 +00:00
SemaTemplateInstantiate.cpp [Sema] ArrayRef-ize ActOnBaseSpecifiers. NFC 2015-12-27 21:55:19 +00:00
SemaTemplateInstantiateDecl.cpp ArrayRef-ize TemplateParameterList. NFC 2015-12-27 07:16:27 +00:00
SemaTemplateVariadic.cpp [OpenCL] Pipe type support 2016-01-09 12:53:17 +00:00
SemaType.cpp [OpenCL] Pipe type support 2016-01-09 12:53:17 +00:00
TreeTransform.h Add OpenMP dist_schedule clause to distribute directive and related regression tests. 2016-01-15 18:50:31 +00:00
TypeLocBuilder.cpp [C++11] Use 'nullptr'. Sema edition. 2014-05-26 06:22:03 +00:00
TypeLocBuilder.h Revert r240270 ("Fixed/added namespace ending comments using clang-tidy"). 2015-06-22 23:07:51 +00:00