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

            Bug ID: 41368
           Summary: clang++ accepts self-referring static member
                    initialization
           Product: clang
           Version: 8.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected], [email protected],
                    [email protected]

GodBolt example: https://godbolt.org/z/1orC3P
StackOverflow question (which started out differently):
https://stackoverflow.com/q/55505257/1593077

Consider the following code:

  struct bar { static const bool value = !bar::value; };

This should not compile; and indeed, it doesn't - with GCC and with MSVC. Yet
clang++ is somehow willing to take a default-initialization value for
bar::value before it has actually been initialized. I am not a C++ language
lawyer, but I'm sure that's wrong.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to