[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[Bug c++/23896] [4.0/4.1 Regression] boost::tie() = std::pair doesn't compile



------- Additional Comments From bangerth at dealii dot org  2005-09-15 17:56 -------
This is what I come up with: 
------------------- 
template <int> struct X {}; 
 
template <typename T> struct length { 
    static const int value = 2; 
}; 
 
template <typename T> void foo () { 
  sizeof(X<length<T>::value>); 
} 
 
template void foo<int>(); 
----------------------------- 
 
g/x> /home/bangerth/bin/gcc-3.4*-pre/bin/c++ -c x.cc 
 
g/x> /home/bangerth/bin/gcc-4.0*-pre/bin/c++ -c x.cc 
x.cc: In function &#8216;void foo() [with T = int]&#8217;: 
x.cc:11:   instantiated from here 
x.cc:8: error: &#8216;length<int>::value&#8217; is not a valid template argument for type 
&#8216;int&#8217; because it is a non-constant expression 
 
g/x> /home/bangerth/bin/gcc-4.1*-pre/bin/c++ -c x.cc 
x.cc: In function &#8216;void foo() [with T = int]&#8217;: 
x.cc:11:   instantiated from here 
x.cc:8: error: &#8216;length<int>::value&#8217; is not a valid template argument for type 
&#8216;int&#8217; because it is a non-constant expression 
 
W. 

-- 


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

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.



Reply to: