[LLVMbugs] [Bug 13293] New: 'auto' prematurely deduced if the declarator is dependent

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Jul 7 19:57:21 PDT 2012


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

             Bug #: 13293
           Summary: 'auto' prematurely deduced if the declarator is
                    dependent
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++11
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: richard-llvm at metafoo.co.uk
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified


This is valid code, which should deduce *p's return type:

int f(int);
template<typename T> struct S {
  static constexpr auto (*p)(T) = &f;
};

Clang diagnoses it:

error: variable 'p' with type 'auto (*const)(T)' has incompatible initializer
of type 'int (*)(int)'
  static constexpr auto (*p)(T) = &f; };
                          ^       ~~

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