https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104197

            Bug ID: 104197
           Summary: clang: gcc/cp/pt.cc:28481:19: warning: predefined
                    identifier is only valid inside function
                    [-Wpredefined-identifier-outside-function]
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: marxin at gcc dot gnu.org
                CC: ppalka at gcc dot gnu.org
  Target Milestone: ---

I noticed the following new warning by clang:

/home/marxin/Programming/gcc/gcc/cp/pt.cc:28481:19: warning: predefined
identifier is only valid inside function
[-Wpredefined-identifier-outside-function]
             int level = current_template_depth + 1)
                         ^
/home/marxin/Programming/gcc/gcc/cp/cp-tree.h:1903:29: note: expanded from
macro 'current_template_depth'
  (current_template_parms ? TMPL_PARMS_DEPTH (current_template_parms) : 0)
                            ^
/home/marxin/Programming/gcc/gcc/cp/cp-tree.h:3802:38: note: expanded from
macro 'TMPL_PARMS_DEPTH'
  ((HOST_WIDE_INT) TREE_INT_CST_LOW (TREE_PURPOSE (NODE)))
                                     ^
/home/marxin/Programming/gcc/gcc/tree.h:1098:29: note: expanded from macro
'TREE_PURPOSE'
#define TREE_PURPOSE(NODE) (TREE_LIST_CHECK (NODE)->list.purpose)
                            ^
./tree-check.h:8:28: note: expanded from macro 'TREE_LIST_CHECK'
#define TREE_LIST_CHECK(t)      TREE_CHECK (t, TREE_LIST)
                                ^
/home/marxin/Programming/gcc/gcc/tree.h:252:39: note: expanded from macro
'TREE_CHECK'
(tree_check ((T), __FILE__, __LINE__, __FUNCTION__, (CODE)))
                                      ^
Is it something we should care about, or is it a false alarm?

Reply via email to