[llvm-bugs] [Bug 42042] New: Wmissing-variable-declarations for variable templates with auto deduction

via llvm-bugs llvm-bugs at lists.llvm.org
Mon May 27 17:00:21 PDT 2019


https://bugs.llvm.org/show_bug.cgi?id=42042

            Bug ID: 42042
           Summary: Wmissing-variable-declarations for variable templates
                    with auto deduction
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: mark.sonnentag at gmx.de
                CC: llvm-bugs at lists.llvm.org, neeilans at live.com,
                    richard-llvm at metafoo.co.uk

Hi,

Clang reports missing-variable-declarations for variable templates if the type
is auto deduced, whereas no warning is reported if the type is specified:

/////////////////////////////////////////////////////////

// no warning:
template<typename T>
constexpr bool foo = T{};

// warning: no previous extern declaration for non-static variable 
// auto_foo<bool>
template<typename T>
constexpr auto auto_foo = T{};


int main(){
    foo<bool>;
    auto_foo<bool>;
}


////////////////////////////////////////////////////////
Apparently Clang reported the same warning for variable templates with specific
types before (bug 35862).

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190528/ea2e63ba/attachment-0001.html>


More information about the llvm-bugs mailing list