summaryrefslogtreecommitdiff
path: root/clang/test/CodeGenCXX/function-template-specialization.cpp
AgeCommit message (Collapse)Author
2025-03-05[Clang] Don't give up on an unsuccessful function instantiation (#126723)Younan Zhang
For constexpr function templates, we immediately instantiate them upon reference. However, if the function isn't defined at the time of instantiation, even though it might be defined later, the instantiation would forever fail. This patch corrects the behavior by popping up failed instantiations through PendingInstantiations, so that we are able to instantiate them again in the future (e.g. at the end of TU.) Fixes https://github.com/llvm/llvm-project/issues/125747
2014-12-16AST: Fix the linkage of static vars in fn template specializationsDavid Majnemer
We that static variables in function template specializations were externally visible. The manglers assumed that externally visible static variables were numbered in Sema. We would end up mangling static variables in the same specialization with the same mangling number which would give all of them the same name. This fixes PR21904. llvm-svn: 224316
2014-01-14Remove the -cxx-abi command-line flag.Hans Wennborg
This makes the C++ ABI depend entirely on the target: MS ABI for -win32 triples, Itanium otherwise. It's no longer possible to do weird combinations. To be able to run a test with a specific ABI without constraining it to a specific triple, new substitutions are added to lit: %itanium_abi_triple and %ms_abi_triple can be used to get the current target triple adjusted to the desired ABI. For example, if the test suite is running with the i686-pc-win32 target, %itanium_abi_triple will expand to i686-pc-mingw32. Differential Revision: http://llvm-reviews.chandlerc.com/D2545 llvm-svn: 199250
2013-12-13Prepare for using MS ABI by default for Win32: update CodeGenCXX testsHans Wennborg
llvm-svn: 197281
2009-12-15Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.Daniel Dunbar
- This is designed to make it obvious that %clang_cc1 is a "test variable" which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it can be useful to redefine what gets run as 'clang -cc1' (for example, to set a default target). llvm-svn: 91446
2009-09-17Substitute unscoped template names.Anders Carlsson
llvm-svn: 82119
2009-09-17Get rid of the last grep.Anders Carlsson
llvm-svn: 82115
2009-09-17When mangling function template specialization, mangle the type encoding of ↵Anders Carlsson
the original function template. Also, port mangle.cpp and function-template-specialization.cpp over to using FileCheck. llvm-svn: 82114
2009-09-17Add basic substitution to the C++ mangler. It currently only looks at types.Anders Carlsson
llvm-svn: 82102
2009-07-27Update for LLVM API change.Owen Anderson
llvm-svn: 77249
2009-06-29Improve code generation for function template specializations:Douglas Gregor
- Track implicit instantiations vs. the not-yet-supported explicit specializations - Give implicit instantiations of function templates (and member functions of class templates) linkonce_odr linkage. - Improve name mangling for function template specializations, including the template arguments of the instantiation and the return type of the function. Note that our name-mangling is improved, but not correct: we still don't mangle substitutions, although the manglings we produce can be demangled. llvm-svn: 74466
2009-06-29Keep track of function template specializations, to eliminateDouglas Gregor
redundant, implicit instantiations of function templates and provide a place where we can hang function template specializations. llvm-svn: 74454