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

            Bug ID: 80251
           Summary: Is the is_aggregate meta function missing?
           Product: gcc
           Version: 7.0.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gcc-bugs at marehr dot dialup.fu-berlin.de
  Target Milestone: ---

Hi gcc-team,

is is_aggregate [1] really missing or is it within some experimental
namespaces?

If I try to compile the following:

```c++
#include <type_traits>

struct aggregate_t {
  int foo;
  int bar;
};

int main() {
  aggregate_t foo;
  static_assert(std::is_aggregate_v<decltype(foo)>>);
  return 0;
}

```

It will result in the following error:

```terminal
bug_gcc_is_aggregate.cpp: In function ‘int main()’:
bug_gcc_is_aggregate.cpp:10:22: error: ‘is_aggregate_v’ is not a member of
‘std’
   static_assert(std::is_aggregate_v<decltype(foo)>>);

                      ^~~~~~~~~~~~~~
bug_gcc_is_aggregate.cpp:10:22: note: suggested alternative: ‘is_array_v’
   static_assert(std::is_aggregate_v<decltype(foo)>>);
                      ^~~~~~~~~~~~~~
                      is_array_v
bug_gcc_is_aggregate.cpp:10:37: error: expected primary-expression before
‘decltype’
   static_assert(std::is_aggregate_v<decltype(foo)>>);
                                     ^~~~~~~~
bug_gcc_is_aggregate.cpp:10:37: error: expected ‘,’ before ‘decltype’
bug_gcc_is_aggregate.cpp:10:37: error: expected string-literal before
‘decltype’
bug_gcc_is_aggregate.cpp:10:37: error: expected ‘)’ before ‘decltype’
zsh: exit 1     g++-7 -std=gnu++1z -Wall -Wextra bug_gcc_is_aggregate.cpp
```

[1] http://en.cppreference.com/w/cpp/types/is_aggregate

Reply via email to