public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "nathan at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/107442] New: Concept and Template Var mangling Date: Thu, 27 Oct 2022 18:12:11 +0000 [thread overview] Message-ID: <bug-107442-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107442 Bug ID: 107442 Summary: Concept and Template Var mangling Product: gcc Version: 13.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: nathan at gcc dot gnu.org Target Milestone: --- From a discussion re clang's mangling (https://github.com/llvm/llvm-project/issues/58197), I find some GCC cases namespace Concept { template<typename> concept True = true; } namespace Struct_ { template<typename> struct True {}; } namespace Var____ { template<typename> constexpr bool True = true; } namespace Functio { template<typename> void True (); } template <bool> struct ImplExpr { template <typename T> using Type = T; }; template <typename> struct ImplType { template <typename T> using Type = T; }; template <void ()> struct ImplFunc { template <typename T> using Type = T; }; template <bool C, typename T> using IfExpr = typename ImplExpr<C>::template Type<T>; template <typename C, typename T> using IfType = typename ImplType<C>::template Type<T>; template <void C (), typename T> using IfFunc = typename ImplFunc<C>::template Type<T>; template<typename T> using TypeConcept = IfExpr<Concept::True<T>, T>; template<typename T> using TypeStruct_ = IfType<Struct_::True<T>, T>; template<typename T> using TypeVar____ = IfExpr<Var____::True<T>, T>; template<typename T> using TypeFunctio = IfFunc<Functio::True<T>, T>; template<typename T> TypeConcept<T> fConcept () {return {};} template<typename T> TypeStruct_<T> fStruct_ () {return {};} template<typename T> TypeVar____<T> fVar____ () {return {};} template<typename T> TypeFunctio<T> fFunctio () {return {};} int main () { fConcept<int> (); fStruct_<int> (); fVar____<int> (); fFunctio<int> (); } neroon:270>./cc1plus -quiet -std=c++20 conc2.cc -o - | grep '^_Z' _Z8fConceptIiEN8ImplExprIX4TrueIT_EEE4TypeIS1_EEv: _Z8fStruct_IiEN8ImplTypeIN7Struct_4TrueIT_EEE4TypeIS3_EEv: _Z8fVar____IiEN8ImplExprIX4TrueIT_EEE4TypeIS1_EEv: _Z8fFunctioIiEN8ImplFuncIX4TrueIT_EEE4TypeIS1_EEv: _ZN7Var____4TrueIiEE: neroon:270>clang++ -S -std=c++20 conc2.cc -o - | grep '^_Z' _Z8fConceptIiEN8ImplExprIL_ZN7Concept4TrueIT_EEEE4TypeIS3_EEv: # @_Z8fConceptIiEN8ImplExprIL_ZN7Concept4TrueIT_EEEE4TypeIS3_EEv _Z8fStruct_IiEN8ImplTypeIN7Struct_4TrueIT_EEE4TypeIS3_EEv: # @_Z8fStruct_IiEN8ImplTypeIN7Struct_4TrueIT_EEE4TypeIS3_EEv _Z8fVar____IiEN8ImplExprIXsr7Var____E4TrueIT_EEE4TypeIS1_EEv: # @_Z8fVar____IiEN8ImplExprIXsr7Var____E4TrueIT_EEE4TypeIS1_EEv _Z8fFunctioIiEN8ImplFuncIXsr7FunctioE4TrueIT_EEE4TypeIS1_EEv: # @_Z8fFunctioIiEN8ImplFuncIXsr7FunctioE4TrueIT_EEE4TypeIS1_EEv We're dropping the scoping off Concept::True<T> and Var____::True<T> & Functio::True<T> (we're representing these as TEMPLATE_ID_EXPRs, and the mangler only expects an unqualified function there). Should we represent these using ScopeRef, like clang does for the variable case (the clang issue is what should it do for the concept case). Or should we mangle both concept and var as a template instantiation like the class case?
reply other threads:[~2022-10-27 18:12 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-107442-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).