Boost C++ Libraries: Ticket #1734: BOOST_STATIC_WARNING can't be passed a dependent expression https://svn.boost.org/trac10/ticket/1734 <p> This breaks Boost.Serialization on conforming compilers like <a class="missing wiki">Intel/Linux</a>. </p> <div class="wiki-code"><div class="code"><pre><span class="cp">#include</span> <span class="cpf">&quot;boost/static_warning.hpp&quot;</span><span class="cp"></span> <span class="k">template</span> <span class="o">&lt;</span><span class="k">class</span> <span class="nc">T</span><span class="o">&gt;</span> <span class="kt">int</span> <span class="n">f</span><span class="p">()</span> <span class="p">{</span> <span class="n">BOOST_STATIC_WARNING</span><span class="p">(</span><span class="n">T</span><span class="o">::</span><span class="n">value</span><span class="p">);</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span> <span class="p">}</span> <span class="k">struct</span> <span class="n">A</span><span class="p">{</span> <span class="k">enum</span> <span class="p">{</span> <span class="n">value</span> <span class="o">=</span> <span class="nb">true</span> <span class="p">};</span> <span class="p">};</span> <span class="kt">int</span> <span class="n">x</span> <span class="o">=</span> <span class="n">f</span><span class="o">&lt;</span><span class="n">A</span><span class="o">&gt;</span><span class="p">();</span> </pre></div></div><p> The problem is that there's a missing <code>typename</code> in the code generated by the macro: </p> <div class="wiki-code"><div class="code"><pre><span class="k">template</span> <span class="o">&lt;</span><span class="k">class</span> <span class="nc">T</span><span class="o">&gt;</span> <span class="kt">int</span> <span class="n">f</span><span class="p">()</span> <span class="p">{</span> <span class="k">struct</span> <span class="n">STATIC_WARNING7</span> <span class="p">{</span> <span class="o">::</span><span class="n">boost</span><span class="o">::</span><span class="n">static_warning_impl</span><span class="o">&lt;</span><span class="p">(</span><span class="kt">bool</span><span class="p">)(</span> <span class="n">T</span><span class="o">::</span><span class="n">value</span> <span class="p">)</span><span class="o">&gt;</span> <span class="o">::</span><span class="n">type</span><span class="o">*</span> <span class="n">p</span><span class="p">;</span> <span class="kt">void</span> <span class="nf">f</span><span class="p">()</span> <span class="p">{</span> <span class="k">delete</span> <span class="n">p</span><span class="p">;</span> <span class="p">}</span> <span class="p">};</span> <span class="c1">// ---------------------^ HERE</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span> <span class="p">}</span> </pre></div></div><p> I think there are tricks that can help you get around this requirement (ask Daniel Wallin what he did in the Parameter library), but in the meantime BOOST_STATIC_WARNING should at least be made into a no-op for Intel C++. That is enough to get the library working on one additional platform and might even be an acceptable change for 1.35.0 </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/1734 Trac 1.4.3 Robert Ramey Sun, 08 Jun 2008 04:52:24 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/1734#comment:1 https://svn.boost.org/trac10/ticket/1734#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> I spend a good deal of time trying to figure out a way around this. </p> <p> I couldn't find a satisactory solution so I just skipeed the checking for this compiler. </p> <p> RObert Ramey </p> Ticket