Skip to content

[BUG] Error when building cppfront with Apple clang 15 #690

Closed
@fedapo

Description

@fedapo

Describe the bug
Error when building cppfront due to a static declaration within a class that uses the full type of the class itself.

source/parse.h:1029:50: note: in instantiation of member function 'std::vector<cpp2::template_argument>::~vector' requested here
    static inline std::vector<template_argument> no_template_args;
                                                 ^
source/parse.h:1015:8: note: definition of 'cpp2::template_argument' is not complete until the closing '}'
struct template_argument

The error shows compiling cppfront on a MacOS, older compilers are less strict and this might be the reason why the error has crept in. It still appears to be a true problem.

To Reproduce
On a MacOS jus build cppfront

g++ source/cppfront.cpp -std=c++20 -o cppfront

Additional context
The version of the compiler is the following.

> g++ --version
Apple clang version 15.0.0 (clang-1500.0.40.1)
Target: x86_64-apple-darwin22.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions