public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/39970] gcc accepts the . dot operator in template arguments
       [not found] <bug-39970-4@http.gcc.gnu.org/bugzilla/>
@ 2012-01-06 15:15 ` jason at gcc dot gnu.org
  2012-04-24 17:33 ` paolo.carlini at oracle dot com
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jason at gcc dot gnu.org @ 2012-01-06 15:15 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39970

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-01-06
                 CC|                            |jason at gcc dot gnu.org
     Ever Confirmed|0                           |1

--- Comment #2 from Jason Merrill <jason at gcc dot gnu.org> 2012-01-06 15:15:25 UTC ---
We started rejecting this testcase in 3.4 due to the access violation.  If we
change 'class' to 'struct' we still don't (as of pre-4.7) diagnose the invalid
constant-expression because the default argument is never used.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/39970] gcc accepts the . dot operator in template arguments
       [not found] <bug-39970-4@http.gcc.gnu.org/bugzilla/>
  2012-01-06 15:15 ` [Bug c++/39970] gcc accepts the . dot operator in template arguments jason at gcc dot gnu.org
@ 2012-04-24 17:33 ` paolo.carlini at oracle dot com
  2012-04-25 12:09 ` paolo.carlini at oracle dot com
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-04-24 17:33 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39970

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
                 CC|gcc-bugs at gcc dot gnu.org |
         AssignedTo|unassigned at gcc dot       |paolo.carlini at oracle dot
                   |gnu.org                     |com
   Target Milestone|---                         |4.8.0

--- Comment #3 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-04-24 17:32:27 UTC ---
On it.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/39970] gcc accepts the . dot operator in template arguments
       [not found] <bug-39970-4@http.gcc.gnu.org/bugzilla/>
  2012-01-06 15:15 ` [Bug c++/39970] gcc accepts the . dot operator in template arguments jason at gcc dot gnu.org
  2012-04-24 17:33 ` paolo.carlini at oracle dot com
@ 2012-04-25 12:09 ` paolo.carlini at oracle dot com
  2013-03-22 14:44 ` jakub at gcc dot gnu.org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-04-25 12:09 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39970

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |NEW
         AssignedTo|paolo.carlini at oracle dot |unassigned at gcc dot
                   |com                         |gnu.org

--- Comment #4 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-04-25 12:08:54 UTC ---
Not actively working on this.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/39970] gcc accepts the . dot operator in template arguments
       [not found] <bug-39970-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2012-04-25 12:09 ` paolo.carlini at oracle dot com
@ 2013-03-22 14:44 ` jakub at gcc dot gnu.org
  2013-05-31 11:01 ` jakub at gcc dot gnu.org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-03-22 14:44 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39970

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.8.0                       |4.8.1

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-03-22 14:43:58 UTC ---
GCC 4.8.0 is being released, adjusting target milestone.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/39970] gcc accepts the . dot operator in template arguments
       [not found] <bug-39970-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2013-03-22 14:44 ` jakub at gcc dot gnu.org
@ 2013-05-31 11:01 ` jakub at gcc dot gnu.org
  2013-10-16  9:49 ` jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-05-31 11:01 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39970

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.8.1                       |4.8.2

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 4.8.1 has been released.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/39970] gcc accepts the . dot operator in template arguments
       [not found] <bug-39970-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2013-05-31 11:01 ` jakub at gcc dot gnu.org
@ 2013-10-16  9:49 ` jakub at gcc dot gnu.org
  2015-06-22 14:26 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-10-16  9:49 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39970

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.8.2                       |4.8.3

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 4.8.2 has been released.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/39970] gcc accepts the . dot operator in template arguments
       [not found] <bug-39970-4@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2013-10-16  9:49 ` jakub at gcc dot gnu.org
@ 2015-06-22 14:26 ` rguenth at gcc dot gnu.org
  2020-07-16  0:23 ` arthur.j.odwyer at gmail dot com
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-06-22 14:26 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=39970

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.8.3                       |---


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/39970] gcc accepts the . dot operator in template arguments
       [not found] <bug-39970-4@http.gcc.gnu.org/bugzilla/>
                   ` (6 preceding siblings ...)
  2015-06-22 14:26 ` rguenth at gcc dot gnu.org
@ 2020-07-16  0:23 ` arthur.j.odwyer at gmail dot com
  2020-07-17  2:56 ` bbnickell at gmail dot com
  2021-08-04  6:01 ` pinskia at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: arthur.j.odwyer at gmail dot com @ 2020-07-16  0:23 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=39970

Arthur O'Dwyer <arthur.j.odwyer at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |arthur.j.odwyer at gmail dot com

--- Comment #9 from Arthur O'Dwyer <arthur.j.odwyer at gmail dot com> ---
As of C++11, the original code is legitimate-ish:

struct blah { int member; };
constexpr blah global = {42};

template <int param=global.member>
class template_blah { };

template_blah<> x;  // OK, param is 42

But:
(1) GCC still incorrectly accepts the template even when `global` is non-const.
So does MSVC. Clang correctly(?) rejects it.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96213 might be related.


(2) I don't understand Brandon's original concern around mangling operator dot.
The value of the default argument here is just "42"; we don't have to mangle
the dot at all.

An example of name-mangling the dot operator would be like

    template<class T>
    decltype(T().x) foo() { return 0; }
    struct S { int x; };
    template int foo<S>();

which GCC correctly mangles as `_Z3fooI1SEDtdtcvT__E1xEv`.

So I think the only remaining issue here is the incorrect acceptance of a
non-const default argument for `int param`, and that part MIGHT duplicate bug
#96213 which I just filed.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/39970] gcc accepts the . dot operator in template arguments
       [not found] <bug-39970-4@http.gcc.gnu.org/bugzilla/>
                   ` (7 preceding siblings ...)
  2020-07-16  0:23 ` arthur.j.odwyer at gmail dot com
@ 2020-07-17  2:56 ` bbnickell at gmail dot com
  2021-08-04  6:01 ` pinskia at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: bbnickell at gmail dot com @ 2020-07-17  2:56 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=39970

--- Comment #10 from Brandon Nickell <bbnickell at gmail dot com> ---
Well I did open this bug 11 years ago (time flies!) and C++0x was still in mid
flight before it turned into C++11, so quite a bit has changed since this was
originally reported (for instance there was no constexpr or decltype which is
used in the previous comment). At the time there was nothing in the name
mangling scheme that clarified how you would even handle mangling the
global.member template parameter as it was unusual that it would even be
accepted. FWIW, I suspect this test case is correctly rejected in Edison Design
Group's front end but cannot immediately confirm. Thanks.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/39970] gcc accepts the . dot operator in template arguments
       [not found] <bug-39970-4@http.gcc.gnu.org/bugzilla/>
                   ` (8 preceding siblings ...)
  2020-07-17  2:56 ` bbnickell at gmail dot com
@ 2021-08-04  6:01 ` pinskia at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-04  6:01 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=39970

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2018-09-13 00:00:00         |2021-8-3

--- Comment #11 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
For the original code, GCC does not reject the code unless the default value is
used.

MSVC also accepts the code.
ICC and clang both reject it.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/39970] gcc accepts the . dot operator in template arguments
  2009-04-29 23:45 [Bug c++/39970] New: " bbnickell at gmail dot com
@ 2009-07-31 18:18 ` bbnickell at gmail dot com
  0 siblings, 0 replies; 11+ messages in thread
From: bbnickell at gmail dot com @ 2009-07-31 18:18 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from bbnickell at gmail dot com  2009-07-31 18:18 -------
Additionally, there does not appear to be a way to represent the dot argument
in the current IA64 name-mangling scheme:

http://www.codesourcery.com/public/cxx-abi/abi.html#mangling-type

I would like some clarifying remarks as to whether or not this is an
undocumented gcc extension, otherwise this should perhaps be considered as a
potentially serious flaw in the gcc compiler.

Thanks!
Brandon Nickell
email: bbnickell@gmail.com


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39970


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2021-08-04  6:01 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-39970-4@http.gcc.gnu.org/bugzilla/>
2012-01-06 15:15 ` [Bug c++/39970] gcc accepts the . dot operator in template arguments jason at gcc dot gnu.org
2012-04-24 17:33 ` paolo.carlini at oracle dot com
2012-04-25 12:09 ` paolo.carlini at oracle dot com
2013-03-22 14:44 ` jakub at gcc dot gnu.org
2013-05-31 11:01 ` jakub at gcc dot gnu.org
2013-10-16  9:49 ` jakub at gcc dot gnu.org
2015-06-22 14:26 ` rguenth at gcc dot gnu.org
2020-07-16  0:23 ` arthur.j.odwyer at gmail dot com
2020-07-17  2:56 ` bbnickell at gmail dot com
2021-08-04  6:01 ` pinskia at gcc dot gnu.org
2009-04-29 23:45 [Bug c++/39970] New: " bbnickell at gmail dot com
2009-07-31 18:18 ` [Bug c++/39970] " bbnickell at gmail dot com

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).