public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/70667] SFINAE error disambiguating using alignas
[not found] <bug-70667-4@http.gcc.gnu.org/bugzilla/>
@ 2024-04-04 21:30 ` pinskia at gcc dot gnu.org
2024-04-04 21:33 ` pinskia at gcc dot gnu.org
1 sibling, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-04-04 21:30 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70667
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
So if we have (note the extra f which has no arguments):
```
template <int N> struct A { alignas (N) int a; };
template <int N> struct B { char c; };
template <int N> int f (int (*)[sizeof (A<N>)]) { return 0; }
template <int N> int f (int (*)[sizeof (B<N>)]) { return 1; }
template <int N> int f () { return 2; }
int i = f<3>();
```
This started to get accepted in GCC 12.
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Bug c++/70667] SFINAE error disambiguating using alignas
[not found] <bug-70667-4@http.gcc.gnu.org/bugzilla/>
2024-04-04 21:30 ` [Bug c++/70667] SFINAE error disambiguating using alignas pinskia at gcc dot gnu.org
@ 2024-04-04 21:33 ` pinskia at gcc dot gnu.org
1 sibling, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-04-04 21:33 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70667
--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
If we had:
```
int i = f<3>(nullptr);
```
clang, edg and MSVC also rejects it for the same reason as GCC.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-04-04 21:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <bug-70667-4@http.gcc.gnu.org/bugzilla/>
2024-04-04 21:30 ` [Bug c++/70667] SFINAE error disambiguating using alignas pinskia at gcc dot gnu.org
2024-04-04 21:33 ` pinskia at gcc dot gnu.org
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).