No diagnostic for C++03 14.6.4.2 ?

Hi all,

I'm not a language lawyer, but consider:

This is llvm.org/PR7396 which was resolved wontfix.

Nick

Hi all,

I'm not a language lawyer, but consider:

----------------------
#include <stdio.h>

static void PrintIt(double value)
{
  printf("value is %f \n", value);
}

template <class T>
void Function(T *value)
{
  PrintIt(*value);
}

int main ()
{
  int x = 1;
  Function(&x);

  short y = 2;
  Function(&y);

  return x + y;
}
----------------------

clang -std=c++03 -pedantic -Weverything test.cxx

gives no warning/error. C++03 14.6.4.2 seems to say that, since PrintIt()
is static, it should not be found. xlc generates an error:

  *The name lookup for "PrintIt" did not find a declaration.
  *Static declarations are not considered for a function call if the
function is not qualified.

Shouldn't clang be producing a diagnostic here?

This rule was changed by DR561:

http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#561

This has status CD2, which means "CD2: A DR issue not resolved in CD1 but
included in the Final Committee Draft advanced for balloting at the March,
2010 WG21 meeting." And DR means "DR: The full Committee has approved the
item as a proposed defect report.", as opposed to "Accepted: Like a DR
except that the issue concerns the wording of the current Working Paper
rather than that of the current International Standard."

That is, issue 561 was a defect in C++03 and the committee's intent was
that the language not work that way. Our "C++03" mode is ISO C++03 plus
defect reports, so includes this bug fix to C++03.