fork download
  1. // RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
  2. // rdar://10246395
  3.  
  4. #define WEAK __attribute__ ((weak))
  5.  
  6. class WEAK A {
  7. virtual void foo();
  8. };
  9.  
  10. class B : public A {
  11. virtual void foo();
  12. };
  13. void A::foo() { }
  14. void B::foo() { }
  15.  
  16. class T {};
  17. class T1 {};
  18.  
  19. class C : public T1, public B, public T {
  20. virtual void foo();
  21. };
  22. void C::foo() { }
  23.  
  24. class V1 : public virtual A {
  25. virtual void foo();
  26. };
  27.  
  28. class V2 : public virtual V1 {
  29. virtual void foo();
  30. };
  31. void V1::foo() { }
  32. void V2::foo() { }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:6:12: warning: ‘weak’ attribute does not apply to types [-Wattributes]
 class WEAK A {
            ^
/usr/lib/gcc/i486-linux-gnu/4.8/../../../i386-linux-gnu/crt1.o: In function `_start':
(.text+0x18): undefined reference to `main'
collect2: error: ld returned 1 exit status
stdout
Standard output is empty