public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/9050] Can't explicitly specialize C++ constructor templates
       [not found] <bug-9050-2393@http.gcc.gnu.org/bugzilla/>
@ 2008-02-11 22:20 ` vlad dot sharanhovich at gmail dot com
  2008-02-11 23:44 ` manu at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 12+ messages in thread
From: vlad dot sharanhovich at gmail dot com @ 2008-02-11 22:20 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from vlad dot sharanhovich at gmail dot com  2008-02-11 22:19 -------
This bug is present in gcc 3.4.3. Was ever fixed or forgotten forever?


-- 

vlad dot sharanhovich at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |vlad dot sharanhovich at
                   |                            |gmail dot com


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


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

* [Bug c++/9050] Can't explicitly specialize C++ constructor templates
       [not found] <bug-9050-2393@http.gcc.gnu.org/bugzilla/>
  2008-02-11 22:20 ` [Bug c++/9050] Can't explicitly specialize C++ constructor templates vlad dot sharanhovich at gmail dot com
@ 2008-02-11 23:44 ` manu at gcc dot gnu dot org
  2008-10-26 22:02 ` manu at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 12+ messages in thread
From: manu at gcc dot gnu dot org @ 2008-02-11 23:44 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1357 bytes --]



------- Comment #9 from manu at gcc dot gnu dot org  2008-02-11 23:43 -------
(In reply to comment #8)
> This bug is present in gcc 3.4.3. Was ever fixed or forgotten forever?

manuel@gcc12:~$ ~/132202/build/gcc/cc1plus --version
GNU C++ (GCC) version 4.3.0 20080209 (experimental) [trunk revision 132202]
(x86_64-unknown-linux-gnu)
        compiled by GNU C version 4.3.0 20080209 (experimental) [trunk revision
132202], GMP version 4.2.2, MPFR version 2.3.0.
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096

manuel@gcc12:~$ ~/132202/build/gcc/cc1plus src/pr9050.C
 void Y::foo(T) [with T = bool] void Y::foo(T) [with T = int] Y::Y(T) [with T =
bool] Y::Y(T) [with T = bool] Y::Y(T) [with T = bool]
src/pr9050.C: At global scope:
src/pr9050.C:11: error: ‘Y’ is not a template
src/pr9050.C:11: error: expected unqualified-id before ‘int’
src/pr9050.C:11: error: expected `)' before ‘int’

Not fixed.


-- 

manu at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |manu at gcc dot gnu dot org
   Last reconfirmed|2006-09-03 21:39:40         |2008-02-11 23:43:25
               date|                            |


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


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

* [Bug c++/9050] Can't explicitly specialize C++ constructor templates
       [not found] <bug-9050-2393@http.gcc.gnu.org/bugzilla/>
  2008-02-11 22:20 ` [Bug c++/9050] Can't explicitly specialize C++ constructor templates vlad dot sharanhovich at gmail dot com
  2008-02-11 23:44 ` manu at gcc dot gnu dot org
@ 2008-10-26 22:02 ` manu at gcc dot gnu dot org
  2009-11-20  5:17 ` jason at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 12+ messages in thread
From: manu at gcc dot gnu dot org @ 2008-10-26 22:02 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from manu at gcc dot gnu dot org  2008-10-26 22:01 -------
It seems that the problem is cp_parser_template_id fails to parse Y<int> as a
template-id because when it does a lookup it finds that Y is just a
non-template class and concludes that Y<int> cannot be a template-id. This in
turn makes cp_parser_class_name fail to parse Y<int>, which makes
cp_parser_constructor_declarator_p return false.

No idea how this could be fixed...


-- 

manu at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|3.4.3 4.1.2 4.3.0           |3.4.3 4.1.2 4.3.0 4.4.0


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


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

* [Bug c++/9050] Can't explicitly specialize C++ constructor templates
       [not found] <bug-9050-2393@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2008-10-26 22:02 ` manu at gcc dot gnu dot org
@ 2009-11-20  5:17 ` jason at gcc dot gnu dot org
  2009-11-21  3:19 ` [Bug c++/9050] [DR 147] " jason at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 12+ messages in thread
From: jason at gcc dot gnu dot org @ 2009-11-20  5:17 UTC (permalink / raw)
  To: gcc-bugs



-- 

jason at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |jason at gcc dot gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2008-02-11 23:43:25         |2009-11-20 05:17:23
               date|                            |


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


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

* [Bug c++/9050] [DR 147] Can't explicitly specialize C++ constructor templates
       [not found] <bug-9050-2393@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2009-11-20  5:17 ` jason at gcc dot gnu dot org
@ 2009-11-21  3:19 ` jason at gcc dot gnu dot org
  2009-11-21  6:34 ` jason at gcc dot gnu dot org
  2009-11-21  6:34 ` jason at gcc dot gnu dot org
  6 siblings, 0 replies; 12+ messages in thread
From: jason at gcc dot gnu dot org @ 2009-11-21  3:19 UTC (permalink / raw)
  To: gcc-bugs



-- 

jason at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Can't explicitly specialize |[DR 147] Can't explicitly
                   |C++ constructor templates   |specialize C++ constructor
                   |                            |templates
   Target Milestone|---                         |4.5.0


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


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

* [Bug c++/9050] [DR 147] Can't explicitly specialize C++ constructor templates
       [not found] <bug-9050-2393@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2009-11-21  6:34 ` jason at gcc dot gnu dot org
@ 2009-11-21  6:34 ` jason at gcc dot gnu dot org
  6 siblings, 0 replies; 12+ messages in thread
From: jason at gcc dot gnu dot org @ 2009-11-21  6:34 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from jason at gcc dot gnu dot org  2009-11-21 06:34 -------
Subject: Bug 9050

Author: jason
Date: Sat Nov 21 06:33:56 2009
New Revision: 154403

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=154403
Log:
        PR c++/9050, DR 147, DR 318
        * parser.c (cp_parser_lookup_name): If the name matches the explicit
        class scope, we're naming the constructor.
        (cp_parser_constructor_declarator_p): Just use cp_parser_unqualified_id
        if we have a nested-name-specifier.
        (cp_parser_direct_declarator): Handle getting an overload set as a
        constructor declarator.
        (cp_parser_unqualified_id): Avoid looking up the constructor when
        naming the destructor.
        (cp_parser_diagnose_invalid_type_name): Give good
        diagnostic for improper use of constructor as template.
        * typeck.c (finish_class_member_access_expr): Give good diagnostic
        about calling constructor.

        * error.c (dump_aggr_type): Don't print A::A for injected-class-name.

Added:
    trunk/gcc/testsuite/g++.dg/template/ctor9.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/error.c
    trunk/gcc/cp/parser.c
    trunk/gcc/cp/typeck.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/g++.dg/lookup/name-clash4.C
    trunk/gcc/testsuite/g++.dg/tc1/dr147.C
    trunk/gcc/testsuite/g++.old-deja/g++.jason/temporary5.C
    trunk/gcc/testsuite/g++.old-deja/g++.pt/ctor2.C


-- 


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


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

* [Bug c++/9050] [DR 147] Can't explicitly specialize C++ constructor templates
       [not found] <bug-9050-2393@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2009-11-21  3:19 ` [Bug c++/9050] [DR 147] " jason at gcc dot gnu dot org
@ 2009-11-21  6:34 ` jason at gcc dot gnu dot org
  2009-11-21  6:34 ` jason at gcc dot gnu dot org
  6 siblings, 0 replies; 12+ messages in thread
From: jason at gcc dot gnu dot org @ 2009-11-21  6:34 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from jason at gcc dot gnu dot org  2009-11-21 06:34 -------
Fixed for 4.5.


-- 

jason at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


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


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

* [Bug c++/9050] [DR 147] Can't explicitly specialize C++ constructor templates
       [not found] <bug-9050-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2012-04-02  7:45 ` schaub.johannes at googlemail dot com
@ 2014-02-16 13:16 ` jackie.rosen at hushmail dot com
  4 siblings, 0 replies; 12+ messages in thread
From: jackie.rosen at hushmail dot com @ 2014-02-16 13:16 UTC (permalink / raw)
  To: gcc-bugs

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

Jackie Rosen <jackie.rosen at hushmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jackie.rosen at hushmail dot com

--- Comment #17 from Jackie Rosen <jackie.rosen at hushmail dot com> ---
*** Bug 260998 has been marked as a duplicate of this bug. ***
Seen from the domain http://volichat.com
Page where seen: http://volichat.com/adult-chat-rooms
Marked for reference. Resolved as fixed @bugzilla.


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

* [Bug c++/9050] [DR 147] Can't explicitly specialize C++ constructor templates
       [not found] <bug-9050-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2012-04-02  5:43 ` jason at gcc dot gnu.org
@ 2012-04-02  7:45 ` schaub.johannes at googlemail dot com
  2014-02-16 13:16 ` jackie.rosen at hushmail dot com
  4 siblings, 0 replies; 12+ messages in thread
From: schaub.johannes at googlemail dot com @ 2012-04-02  7:45 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #16 from Johannes Schaub <schaub.johannes at googlemail dot com> 2012-04-02 07:43:23 UTC ---
(In reply to comment #15)
> (In reply to comment #14)
> 
> Good point, I've pointed out the problem with the proposed resolution.

Note that we currently have
http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#581 open. 

Even when 12.1 would have allowed both the injected class name and it followed
by template-arguments, the name lookup rules would never allow it to match the
second condition because the injected class name would always have been
translated to a name denoting the constructor instead of the class.

So ultimately, 12.1 allowing the injected class name followed by template
arguments could only be used in an unqualified-id constructor declaration in
C++03.


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

* [Bug c++/9050] [DR 147] Can't explicitly specialize C++ constructor templates
       [not found] <bug-9050-4@http.gcc.gnu.org/bugzilla/>
  2012-04-01 14:06 ` schaub.johannes at googlemail dot com
  2012-04-01 14:15 ` schaub.johannes at googlemail dot com
@ 2012-04-02  5:43 ` jason at gcc dot gnu.org
  2012-04-02  7:45 ` schaub.johannes at googlemail dot com
  2014-02-16 13:16 ` jackie.rosen at hushmail dot com
  4 siblings, 0 replies; 12+ messages in thread
From: jason at gcc dot gnu.org @ 2012-04-02  5:43 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|                            |

--- Comment #15 from Jason Merrill <jason at gcc dot gnu.org> 2012-04-02 05:41:08 UTC ---
(In reply to comment #14)

Good point, I've pointed out the problem with the proposed resolution.


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

* [Bug c++/9050] [DR 147] Can't explicitly specialize C++ constructor templates
       [not found] <bug-9050-4@http.gcc.gnu.org/bugzilla/>
  2012-04-01 14:06 ` schaub.johannes at googlemail dot com
@ 2012-04-01 14:15 ` schaub.johannes at googlemail dot com
  2012-04-02  5:43 ` jason at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 12+ messages in thread
From: schaub.johannes at googlemail dot com @ 2012-04-01 14:15 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #14 from Johannes Schaub <schaub.johannes at googlemail dot com> 2012-04-01 14:14:46 UTC ---
(In reply to comment #13)
> Jason, does http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1435
> not render the explicit specialization ill-formed for C++11TC1? It only allows
> a simple identifier, and not a template-id.

FWIW I don't like the resolution of that issue. For a qualified-id, the
injected-class-name is an excellent way for us to know when and when not we
name a constructor, and it is entirely based on name-lookup rules; I don't see
the need to dictate that in clause 12. Only for an unqualified-id, we actually
need the rule to know when we declare a constructor. The allowed
decl-specifiers in a constructor declaration can be stated separately.


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

* [Bug c++/9050] [DR 147] Can't explicitly specialize C++ constructor templates
       [not found] <bug-9050-4@http.gcc.gnu.org/bugzilla/>
@ 2012-04-01 14:06 ` schaub.johannes at googlemail dot com
  2012-04-01 14:15 ` schaub.johannes at googlemail dot com
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 12+ messages in thread
From: schaub.johannes at googlemail dot com @ 2012-04-01 14:06 UTC (permalink / raw)
  To: gcc-bugs

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

Johannes Schaub <schaub.johannes at googlemail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |schaub.johannes at
                   |                            |googlemail dot com

--- Comment #13 from Johannes Schaub <schaub.johannes at googlemail dot com> 2012-04-01 14:03:40 UTC ---
Jason, does http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1435
not render the explicit specialization ill-formed for C++11TC1? It only allows
a simple identifier, and not a template-id.


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

end of thread, other threads:[~2014-02-16 13:16 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-9050-2393@http.gcc.gnu.org/bugzilla/>
2008-02-11 22:20 ` [Bug c++/9050] Can't explicitly specialize C++ constructor templates vlad dot sharanhovich at gmail dot com
2008-02-11 23:44 ` manu at gcc dot gnu dot org
2008-10-26 22:02 ` manu at gcc dot gnu dot org
2009-11-20  5:17 ` jason at gcc dot gnu dot org
2009-11-21  3:19 ` [Bug c++/9050] [DR 147] " jason at gcc dot gnu dot org
2009-11-21  6:34 ` jason at gcc dot gnu dot org
2009-11-21  6:34 ` jason at gcc dot gnu dot org
     [not found] <bug-9050-4@http.gcc.gnu.org/bugzilla/>
2012-04-01 14:06 ` schaub.johannes at googlemail dot com
2012-04-01 14:15 ` schaub.johannes at googlemail dot com
2012-04-02  5:43 ` jason at gcc dot gnu.org
2012-04-02  7:45 ` schaub.johannes at googlemail dot com
2014-02-16 13:16 ` jackie.rosen at hushmail 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).