public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/41995]  New: Incorrect point of instantiation for function template
@ 2009-11-09 11:19 phresnel at gmail dot com
  2009-11-09 12:01 ` [Bug c++/41995] " redi at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: phresnel at gmail dot com @ 2009-11-09 11:19 UTC (permalink / raw)
  To: gcc-bugs

I know this is nitpicky, but I haven't found references to it (or the whys) in
the database.

I am not a lawyer, but I think that according to [0][1], the following program
should not compile:


#include <iostream>

template <typename T>
void f (T t) {
    g (t);
}

int main () {
    f<int> (42);
} // point of instantiation of f<int>(), g(int) not yet visible

void g (int i) {
        std::cout << i << '\n';
}


To my best knowlege, if function g would take a non-intrinsic type, this would
be correct, but with raw int, ADL should not take place, i.e. the call to
g(int) in f<int>(int) refers to an unresolved symbol.


[0] Vandevoorde/Josuttis 10.3.2: Points of Instantiation
(http://books.google.de/books?id=EotSAwuBkJoC&pg=PA146&lpg=PA146&dq=vandevoorde+point+of+instantiation&source=bl&ots=iwJ0D7_jhd&sig=1yVPrdPe2Dx1AtoPFDpAkFKIe2Y&hl=de&ei=0WedSYORD42K0AXf24DgBQ&sa=X&oi=book_result&resnum=1&ct=result#PPA147,M1)
[1] ISO/IEC 14882:2003(draft) 14.6.4.1 Point of instantiation, Item 1


-- 
           Summary: Incorrect point of instantiation for function template
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: phresnel at gmail dot com


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


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

* [Bug c++/41995] Incorrect point of instantiation for function template
  2009-11-09 11:19 [Bug c++/41995] New: Incorrect point of instantiation for function template phresnel at gmail dot com
@ 2009-11-09 12:01 ` redi at gcc dot gnu dot org
  2009-11-09 12:18 ` rguenth at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: redi at gcc dot gnu dot org @ 2009-11-09 12:01 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from redi at gcc dot gnu dot org  2009-11-09 12:01 -------
probably related to PR 23885 and/or PR 16635


-- 


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


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

* [Bug c++/41995] Incorrect point of instantiation for function template
  2009-11-09 11:19 [Bug c++/41995] New: Incorrect point of instantiation for function template phresnel at gmail dot com
  2009-11-09 12:01 ` [Bug c++/41995] " redi at gcc dot gnu dot org
@ 2009-11-09 12:18 ` rguenth at gcc dot gnu dot org
  2009-11-09 16:01 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-11-09 12:18 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from rguenth at gcc dot gnu dot org  2009-11-09 12:18 -------
EDG accepts it in strict mode though I also think it's invalid.


-- 


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


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

* [Bug c++/41995] Incorrect point of instantiation for function template
  2009-11-09 11:19 [Bug c++/41995] New: Incorrect point of instantiation for function template phresnel at gmail dot com
  2009-11-09 12:01 ` [Bug c++/41995] " redi at gcc dot gnu dot org
  2009-11-09 12:18 ` rguenth at gcc dot gnu dot org
@ 2009-11-09 16:01 ` pinskia at gcc dot gnu dot org
  2010-01-06 19:45 ` jason at gcc dot gnu dot org
  2010-01-06 19:45 ` jason at gcc dot gnu dot org
  4 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2009-11-09 16:01 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pinskia at gcc dot gnu dot org  2009-11-09 16:00 -------
Actually this is a combition of two issues really.  First is argument dependent
lookup for fundamental types, do they have an assoicated namespaces (I think
there is a bug report for that)?

And then the other bug is the wrong place: PR 16635.


-- 


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


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

* [Bug c++/41995] Incorrect point of instantiation for function template
  2009-11-09 11:19 [Bug c++/41995] New: Incorrect point of instantiation for function template phresnel at gmail dot com
                   ` (3 preceding siblings ...)
  2010-01-06 19:45 ` jason at gcc dot gnu dot org
@ 2010-01-06 19:45 ` jason at gcc dot gnu dot org
  4 siblings, 0 replies; 8+ messages in thread
From: jason at gcc dot gnu dot org @ 2010-01-06 19:45 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from jason at gcc dot gnu dot org  2010-01-06 19:44 -------
http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#225
http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#993


-- 

jason at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  BugsThisDependsOn|                            |16635
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2010-01-06 19:44:45
               date|                            |


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


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

* [Bug c++/41995] Incorrect point of instantiation for function template
  2009-11-09 11:19 [Bug c++/41995] New: Incorrect point of instantiation for function template phresnel at gmail dot com
                   ` (2 preceding siblings ...)
  2009-11-09 16:01 ` pinskia at gcc dot gnu dot org
@ 2010-01-06 19:45 ` jason at gcc dot gnu dot org
  2010-01-06 19:45 ` jason at gcc dot gnu dot org
  4 siblings, 0 replies; 8+ messages in thread
From: jason at gcc dot gnu dot org @ 2010-01-06 19:45 UTC (permalink / raw)
  To: gcc-bugs



-- 

jason at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |SUSPENDED


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


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

* [Bug c++/41995] Incorrect point of instantiation for function template
       [not found] <bug-41995-4@http.gcc.gnu.org/bugzilla/>
  2011-09-25 16:51 ` paolo.carlini at oracle dot com
@ 2011-09-26 17:25 ` jason at gcc dot gnu.org
  1 sibling, 0 replies; 8+ messages in thread
From: jason at gcc dot gnu.org @ 2011-09-26 17:25 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATE
   Target Milestone|---                         |4.7.0

--- Comment #6 from Jason Merrill <jason at gcc dot gnu.org> 2011-09-26 17:07:22 UTC ---
Fixed by the patch for 29131.

*** This bug has been marked as a duplicate of bug 29131 ***


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

* [Bug c++/41995] Incorrect point of instantiation for function template
       [not found] <bug-41995-4@http.gcc.gnu.org/bugzilla/>
@ 2011-09-25 16:51 ` paolo.carlini at oracle dot com
  2011-09-26 17:25 ` jason at gcc dot gnu.org
  1 sibling, 0 replies; 8+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-09-25 16:51 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|SUSPENDED                   |NEW
                 CC|gcc-bugs at gcc dot gnu.org |jason at gcc dot gnu.org

--- Comment #5 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-09-25 16:49:22 UTC ---
Both 225 and 993 have been resolved, as NAD and FDIS, respectively. We should
analyze which are the implication for this..


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

end of thread, other threads:[~2011-09-26 17:07 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-09 11:19 [Bug c++/41995] New: Incorrect point of instantiation for function template phresnel at gmail dot com
2009-11-09 12:01 ` [Bug c++/41995] " redi at gcc dot gnu dot org
2009-11-09 12:18 ` rguenth at gcc dot gnu dot org
2009-11-09 16:01 ` pinskia at gcc dot gnu dot org
2010-01-06 19:45 ` jason at gcc dot gnu dot org
2010-01-06 19:45 ` jason at gcc dot gnu dot org
     [not found] <bug-41995-4@http.gcc.gnu.org/bugzilla/>
2011-09-25 16:51 ` paolo.carlini at oracle dot com
2011-09-26 17:25 ` jason 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).