mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
Merge pull request #13515 from MathiasVP/dataflow-fix-for-self-iterators
C++: Dataflow fix for the self-iterators issue
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
#include "../../../include/iterator.h"
|
||||
int source();
|
||||
|
||||
template<typename T>
|
||||
void sink(T);
|
||||
|
||||
template<> struct std::iterator_traits<unsigned long>
|
||||
{ // get traits from integer type
|
||||
typedef std::input_iterator_tag iterator_category;
|
||||
typedef unsigned long value_type;
|
||||
typedef unsigned long difference_type;
|
||||
typedef unsigned long distance_type;
|
||||
typedef unsigned long * pointer;
|
||||
typedef unsigned long& reference;
|
||||
};
|
||||
|
||||
|
||||
int test() {
|
||||
unsigned long x = source();
|
||||
sink(x); // $ ast ir
|
||||
}
|
||||
Reference in New Issue
Block a user