[LLVMbugs] [Bug 14472] New: debug info for user specified copy ctor inside a template is missing 'const'

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Nov 30 13:51:39 PST 2012


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

             Bug #: 14472
           Summary: debug info for user specified copy ctor inside a
                    template is missing 'const'
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Keywords: googler
          Severity: enhancement
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: dblaikie at gmail.com
                CC: dgregor at apple.com, echristo at gmail.com,
                    llvmbugs at cs.uiuc.edu
            Blocks: 14330
    Classification: Unclassified


If the copy ctor of a class template is written with the injected class name
(as in 'bar') the debug info for the copy ctor is correct (const bar<int>&). If
it is written with an explicit type (as in 'foo(const foo<int>&)') it is
incorrect (foo<int>&).

This shows up in the GDB 7.5 test suite, gdb.cp/templates.exp alongside
PR14471.


template<typename T>
struct foo {
    foo();
    foo(const foo<int>&);
};

foo<int> t;

template<typename T>
struct bar {
  bar();
  bar(const bar&);
};

bar<int> b;
(gdb) ptype foo<int>
type = struct foo<int> {
  public:
    void foo();
    void foo(foo<int> &);
}
(gdb) ptype bar<int>
type = struct bar<int> {
  public:
    void bar();
    void bar(const bar<int> &);
}

-- 
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