[LLVMbugs] [Bug 15103] New: another problem with destructors

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Jan 28 21:51:13 PST 2013


http://llvm.org/bugs/show_bug.cgi?id=15103

             Bug #: 15103
           Summary: another problem with destructors
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: rkotler at mips.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified


This program compiles with g++ but not with clang++.

namespace N {

  struct S {
    ~S() {}

  };

  typedef S S1;

};

void foo() {rkotler at ubuntu-rkotler:~/testmips16/hf$ g++ -S
d3.cpprkotler at ubuntu-rkotler:~/testmips16/hf$  ~/llvm_3_2/install/bin/clang++
d3.cpp -S 
d3.cpp:15:13: error: expected the class name after '~' to name a destructor
  x.N::S1::~S1();
            ^
1 error generated.
rkotler at ubuntu-rkotler:~/testmips16/hf$
  N::S x;

  x.N::S1::~S1();
}


rkotler at ubuntu-rkotler:~/testmips16/hf$ g++ -S
d3.cpprkotler at ubuntu-rkotler:~/testmips16/hf$  ~/llvm_3_2/install/bin/clang++
d3.cpp -S -std=c++98 -g
d3.cpp:14:13: error: expected the class name after '~' to name a destructor
  x.N::S1::~S1();
            ^

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list