Commit 684dcd3d authored by Hans Wennborg's avatar Hans Wennborg
Browse files

Merging r322350, r322405, r322420, r322593:

------------------------------------------------------------------------
r322350 | rtrieu | 2018-01-11 20:42:27 -0800 (Thu, 11 Jan 2018) | 6 lines

[ODRHash] Don't hash friend functions.

In certain combinations of templated classes and friend functions, the body
of friend functions does not get propagated along with function signature.
Exclude friend functions for hashing to avoid this case.

------------------------------------------------------------------------

------------------------------------------------------------------------
r322405 | rtrieu | 2018-01-12 13:49:20 -0800 (Fri, 12 Jan 2018) | 2 lines

Disable test for Windows to fix Windows buildbots.

------------------------------------------------------------------------

------------------------------------------------------------------------
r322420 | rtrieu | 2018-01-12 15:13:33 -0800 (Fri, 12 Jan 2018) | 2 lines

Try to suppress Windows testing again.

------------------------------------------------------------------------

------------------------------------------------------------------------
r322593 | rtrieu | 2018-01-16 11:53:06 -0800 (Tue, 16 Jan 2018) | 6 lines

Add context to why test was disabled on Windows

test/Modules/odr_hash-Friend.cpp triggers an assertion in MicrosoftMangle.cpp
This has been reported in PR35939


------------------------------------------------------------------------

llvm-svn: 322632
parent 96ad2f96
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -478,6 +478,8 @@ void ODRHash::AddFunctionDecl(const FunctionDecl *Function) {

  // TODO: Fix hashing for class methods.
  if (isa<CXXMethodDecl>(Function)) return;
  // And friend functions.
  if (Function->getFriendObjectKind()) return;

  // Skip functions that are specializations or in specialization context.
  const DeclContext *DC = Function;
+14 −0
Original line number Diff line number Diff line
template <class T>
struct iterator {
  void Compare(const iterator &x) { }
  friend void Check(iterator) {}
};

template <class T = int> struct Box {
  iterator<T> I;

  void test() {
    Check(I);
    I.Compare(I);
  }
};
+6 −0
Original line number Diff line number Diff line
#include "Box.h"

void Peek() {
  Box<> Gift;
  Gift.test();
}
+5 −0
Original line number Diff line number Diff line
#include "Box.h"
void x() {
  Box<> Unused;
  //Unused.test();
}
+7 −0
Original line number Diff line number Diff line
#include "Box.h"
#include "M2.h"

void Party() {
  Box<> Present;
  Present.test();
}
Loading