This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/11847] [3.4 regression] reference does not work as template argument any more


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


bangerth at dealii dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
  GCC build triplet|sparc-sun-solaris2.7        |
   GCC host triplet|sparc-sun-solaris2.7        |
 GCC target triplet|sparc-sun-solaris2.7        |
   Last reconfirmed|0000-00-00 00:00:00         |2003-08-07 18:46:04
               date|                            |
            Summary|std::string as template     |[3.4 regression] reference
                   |argument no longer works    |does not work as template
                   |                            |argument any more


------- Additional Comments From bangerth at dealii dot org  2003-08-07 18:46 -------
Indeed, I can confirm this on linux as well. Here's a smaller snippet:
----------------------------
extern const int a;

template <const int&> class X {};

template <typename> struct Y {
    X<a> x;
};

template struct Y<int>;
----------------------------

g/x> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -c x.cc
x.cc: In instantiation of `Y<int>':
x.cc:9:   instantiated from here
x.cc:6: error: could not convert template argument `&a' to `const int&'

This used to work, but doesn't anymore. Since it only happens if Y is
a template class, it seems as if this may have something to do with
two-stage name lookup.

W.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]