Skip to content

warning: inline function '(...)' is not defined (even though it is) #37522

Closed
@banach-space

Description

Bugzilla Link 38174
Version trunk
OS Linux
CC @dwblaikie,@DougGregor

Extended Description

Hello,

class A {
  template <char N>
  struct Foo {
    static constexpr char Bar() { return 0; }
  };

  using Constants = Foo<1>;

  char var = Constants::Bar();
};
$ clang++ -std=c++17 -c bug.cpp 
bug.cpp:4:27: warning: inline function 'A::Foo<'\x01'>::Bar' is not defined [-Wundefined-inline]
    static constexpr char Bar() { return 0; }
                          ^
bug.cpp:9:25: note: used here
  char var = Constants::Bar();
                        ^
1 warning generated.

This warning shouldn't be here, should it? Originally discovered with clang-6, but I've also checked ToT and that also issues a warning. Could be somewhat related to 18781, but that particular problem seems to be fixed.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Labels

bugzillaIssues migrated from bugzillac++clang:frontendLanguage frontend issues, e.g. anything involving "Sema"

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions