Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9075529
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T18:52:43+00:00 2026-06-16T18:52:43+00:00

I want to compile the following file (temp.cpp): #include <iostream> class Foo { public:

  • 0

I want to compile the following file (temp.cpp):

#include <iostream> 

class Foo {
public:
  Foo() = default;
};

int main(){
  std::cout << "Works!" << std::endl;
  return 0;
}

With the following command: clang++ temp.cpp -o temp -std=c++11 -Weverything -Werror

There is an error:

temp.cpp:5:11: error: defaulted function definitions are incompatible with C++98 [-Werror,-Wc++98-compat]

I understand that there is a warning like c++98-compat and it is part of everything. How can I enable all warnings except c++98-compat? Is there a c++11 compatible flag for -Weverything?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T18:52:45+00:00Added an answer on June 16, 2026 at 6:52 pm

    Actually, you probably do not want all the warnings, because a number of warnings can be considered as being stylistic or subjective and others (such as the one you ran afoul of) are just stupid in your situation.

    -Weverything was initially built for two reasons:

    • discovery: it’s pretty hard otherwise to get a list of all available warnings
    • black-listing alternative: with gcc, you cherry pick the warnings you wish to apply (white-listing), with -Weverything you cherry pick those you do not wish to apply; the advantage is that when moving over to a new version of the compiler, you are more likely to benefit from new warnings

    Obviously, discovery is not really compatible with production use; therefore you seem to fall in the black-listing case.

    Clang diagnostics system will output (by default) the name of the most specific warning group that is responsible for generating a warning (here -Wc++98-compat) and each warning group can be turned off by adding no- right after the -W.

    Therefore, for blacklisting, you get:

    -Weverything -Wno-c++98-compat -Wno-...
    

    And you are encouraged to revise the list of blacklisted warnings from time to time (for example, when you upgrade to a newer compiler).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I tried to compile following program (main.cu) with the nvcc (CUDA 5.0 RC): #include
Take the following simple source (name it test.cpp): #include <windows.h> void main() { DebugBreak();
The following code does not want to compile. See the included error message. Code:
Ideally I want a function something like the following (this example doesn't compile): void
I just want to compile the following program on Mac OSX 10.8 using Apple
The following source file will not compile with the MSVC compiler (v15.00.30729.01): /* stest.c
I am trying to compile a small .c file that has the following includes:
I have a CPP source file that uses #if / #endif to compile out
I want to compile an .asm file placed in bin folder in the masm
I want to compile static library in linux for windows. Following is the procedure

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.