[Bug c++/96746] Type Casting in template function should not be type-dependent if the type of the conversion result is not type-dependent.

2021-01-01 Thread masamitsu.murase at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96746

Masamitsu MURASE  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |INVALID

--- Comment #5 from Masamitsu MURASE  ---
Jonathan Wakely, Jakub Jelinek,
Thank you very much for your explanation.
I totally understand that both gcc and clang meet the C ++ specification.

Let me mark this issue as "Resolved" and "Invalid".

Regards,
Murase

[Bug c++/96746] Type Casting in template function should not be type-dependent if the type of the conversion result is not type-dependent.

2020-11-04 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96746

--- Comment #4 from Jakub Jelinek  ---
What Marek explained is that your testcase is buggy, but it may or may not be
diagnosed, unless the template is instantiated.  If you instantiate such
template, it has to be rejected by all implementations, but when only
performing semantic analysis of uninstantiated templates, different
implementations will report different sets of bugs, some are easier to diagnose
in some implementations, others in different ones.

[Bug c++/96746] Type Casting in template function should not be type-dependent if the type of the conversion result is not type-dependent.

2020-11-04 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96746

--- Comment #3 from Jonathan Wakely  ---
The standard says "no diagnostic required". It's not a bug if a compiler
accepts the code.

[Bug c++/96746] Type Casting in template function should not be type-dependent if the type of the conversion result is not type-dependent.

2020-11-04 Thread masamitsu.murase at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96746

--- Comment #2 from Masamitsu MURASE  ---
Thank you very much for your reply, Marek Polacek.

I'm sorry, but I cannot understand your comment clearly.
As you said, I also think that my example should be treated as ill-formed
program.
It **compiles fine** with GCC 11.0 even though it is ill-formed.

It seems that clang and MSVC cause hard error appropriately.

Regards,
Murase

[Bug c++/96746] Type Casting in template function should not be type-dependent if the type of the conversion result is not type-dependent.

2020-08-24 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96746

Marek Polacek  changed:

   What|Removed |Added

 CC||mpolacek at gcc dot gnu.org

--- Comment #1 from Marek Polacek  ---
I don't think it's a bug, probably more of a [temp.res]/8 issue:

The program is ill-formed, no diagnostic required, if:
-- no valid specialization can be generated for a template or a substatement of
a constexpr if statement within a template and the template is not
instantiated, or
[...]