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

            Bug ID: 35862
           Summary: -Wmissing-variable-declarations warnings trigger on
                    inline variables and variable temples
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangb...@nondot.org
          Reporter: metaprogrammingthewo...@gmail.com
                CC: dgre...@apple.com, llvm-bugs@lists.llvm.org

When using -Wmissing-variable-declarations, the warning incorrectly triggers
for both inline variable definitions and for variable templates. Example
warning trigger:

//////////
template< class >
int variable_template = 5;

inline constexpr int inline_variable = 5;
//////////

When compiling the above code, the following warnings are produced:

//////////
2 : <source>:2:5: warning: no previous extern declaration for non-static
variable 'variable_template' [-Wmissing-variable-declarations]
int variable_template = 5;
    ^
4 : <source>:4:22: warning: no previous extern declaration for non-static
variable 'inline_variable' [-Wmissing-variable-declarations]
inline constexpr int inline_variable = 5;
//////////

I suggest that such definitions should be ignored in the context of that
warning.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to