Quantcast
Channel: Intel® C++ Compiler
Viewing all articles
Browse latest Browse all 1616

bug: warning #469 is hidden when function overloaded

$
0
0

Hello,

When compiling example below, you will get warning:

#469: temporary used for initial value of reference to non-const (anachronism)

and when another overload is added (see comment) warning disappears, but compiler still choose "BOOL" overload instead of "OBJECT". Note that disabling microsoft extensions (/Za) brings warning back.

We are using x64 compiler for visual studio 2013, version 15.0.1.148 build 20141023 on windows 7. 

#include <iostream>

struct T {};
struct P { P(T*) {} };

void f(bool&) { std::cout << "BOOL"<< std::endl; }
//uncomment this function to hide compilation warning
//void f(P) { std::cout << "OBJECT"<< std::endl; }

int main() {
  	f(new T);
  	return 0;
}

 


Viewing all articles
Browse latest Browse all 1616

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>