#how to write c++20 in macos ? I have installed latest llvm toolchains

32 messages · Page 1 of 1 (latest)

lusty oriole
#

hey, I want to try c++20, but I found that the compiler cannot detect the current files, please check this images

bold raftBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

graceful forge
#

And did you set the -std=c++20

lusty oriole
#

/usr/local/opt/llvm/bin
/clang++ main.cc -std=c++2a

graceful forge
#

Ah clang

#

Holup

lusty oriole
#

no such argument

graceful forge
#

Standard C++ modules are enabled automatically when the language standard mode is -std=c++20 or newer

#

Which clang version

#

And i believe you need to name file .cppm

#

Instead of .cc

lusty oriole
graceful forge
#

I believe you need clang20

lusty oriole
#

may I ask how to install it with brew ?

graceful forge
#

Huh wait

#

Nah they good

#

Check it out

lusty oriole
#

ok, I got it.
I think I need to compile the module first, and then use the module with main.cc

#

what the hell ?

lusty oriole
#

some questions, why the language server cannot detect the module ?

graceful forge
#

c_cpp_properties.json

lusty oriole
#

here you are

graceful forge
#

You put args different std than in the cppStandard

lusty oriole
#

I don't get it

#

more explain please

lusty oriole
#

sorry, I don't know what do you mean 😂

crystal saffron