[LLVMbugs] [Bug 12932] New: incorrect instantiation of explicit destructor calls with nested scope specifier

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed May 23 20:14:22 PDT 2012


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

             Bug #: 12932
           Summary: incorrect instantiation of explicit destructor calls
                    with nested scope specifier
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: richard-llvm at metafoo.co.uk
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Clang rejects this well-formed code:

struct a { struct b {}; };
template<typename T> void f(typename T::b *p) { p->T::b::~b(); }
template void f<a>(a::b*);

... saying:

<stdin>:1:79: error: use of undeclared identifier 'T'
struct a { struct b {}; }; template<typename T> void f(typename T::b *p) {
p->T::b::~b(); } template void f<a>(a::b*);
                                                                              ^
<stdin>:1:107: note: in instantiation of function template specialization
'f<a>' requested here
struct a { struct b {}; }; template<typename T> void f(typename T::b *p) {
p->T::b::~b(); } template void f<a>(a::b*);
                                                                               
                          ^

Remarkably, it also accepts this ill-formed code:

struct a { struct b {}; };
template<typename T> void f(typename T::b *p) { p->T::~b(); }
template void f<a>(a::b*);

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