public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "s.murthy at outlook dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/115656] Templated ctor use rejected in non-deduced context if class template has template template parameter Date: Wed, 26 Jun 2024 03:57:11 +0000 [thread overview] Message-ID: <bug-115656-4-zg0uXb93pa@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-115656-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115656 --- Comment #2 from Sean Murthy <s.murthy at outlook dot com> --- Compiler version: GCC 11.1 through GCC 14.1 Compiler options: -std=c++20 -Wall -Wextra -pedantic -pedantic-errors -Werror=pedantic Compiler output: <source>: In function 'int main()': <source>:39:13: error: class template argument deduction failed: 39 | A a2(45l); //Error GCC 11.1+: uncomment line above, the error disappears | ^ <source>:39:13: error: no matching function for call to 'A(long int)' <source>:20:5: note: candidate: 'template<class U, template<class> class requires unsigned_integral< <template-parameter-2-1> > V, class S> requires signed_integral<S> A(S)-> A<U, V>' 20 | A(S s) : u_( s < 0 ? -s : s) {} | ^ <source>:20:5: note: template argument deduction/substitution failed: <source>: In substitution of 'template<class U, template<class> class requires unsigned_integral< <template-parameter-2-1> > V, class S> requires signed_integral<S> A(S)-> A<U, V> [with U = unsigned int; V = dv; S = long int]': <source>:39:13: required from here 39 | A a2(45l); //Error GCC 11.1+: uncomment line above, the error disappears | ^ <source>:20:5: error: template constraint failure for 'template<class U, template<class> class requires unsigned_integral< <template-parameter-2-1> > V> requires unsigned_integral<U> struct A' 20 | A(S s) : u_( s < 0 ? -s : s) {} | ^ <source>:20:5: note: constraints not satisfied <source>:17:5: note: candidate: 'template<class U, template<class> class requires unsigned_integral< <template-parameter-2-1> > V> A(U)-> A<U, V>' 17 | A(U u) : u_(u) {}; | ^ <source>:17:5: note: template argument deduction/substitution failed: <source>:13:8: note: candidate: 'template<class U, template<class> class requires unsigned_integral< <template-parameter-2-1> > V> A(A<U, V>)-> A<U, V>' 13 | struct A | ^ <source>:13:8: note: template argument deduction/substitution failed: <source>:39:13: note: mismatched types 'A<U, V>' and 'long int' 39 | A a2(45l); //Error GCC 11.1+: uncomment line above, the error disappears | ^
next prev parent reply other threads:[~2024-06-26 3:57 UTC|newest] Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top 2024-06-26 1:42 [Bug c++/115656] New: " s.murthy at outlook dot com 2024-06-26 1:48 ` [Bug c++/115656] " s.murthy at outlook dot com 2024-06-26 3:57 ` s.murthy at outlook dot com [this message] 2024-06-26 4:13 ` s.murthy at outlook dot com 2024-06-26 4:26 ` s.murthy at outlook dot com 2024-06-26 7:31 ` [Bug c++/115656] [11/12/13/14/15 Regression] " rguenth at gcc dot gnu.org 2024-06-26 14:00 ` mpolacek at gcc dot gnu.org 2024-06-26 19:24 ` s.murthy at outlook dot com
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-115656-4-zg0uXb93pa@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).