1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
  
     | 
    
      // RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm-only %s -verify -DTEST1
// RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm-only %s -verify -DTEST2
#ifdef TEST1
// rdar://15522601
class MyClass {
 static void meth();
};
void MyClass::meth() { } // expected-note {{previous}}
extern "C" {
  void _ZN7MyClass4methEv() { } // expected-error {{definition with same mangled name as another definition}}
}
#elif TEST2
// We expect no warnings here, as there is only declaration of _ZN1TD1Ev function, no definitions.
extern "C" void _ZN1TD1Ev();
struct T {
  ~T() {}
};
void foo() {
  _ZN1TD1Ev();
  T t;
}
extern "C" void _ZN2T2D2Ev() {}; // expected-note {{previous definition is here}}
struct T2 {
  ~T2() {} // expected-error {{definition with same mangled name as another definition}}
};
void bar() {
  _ZN2T2D2Ev();
  T2 t;
}
#else
#error Unknwon test
#endif
 
     |