We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Clang 6.0 implications in cppstd flags
We have added to the `settings.yml` clang 6.0, but we have to review the `cppstd` flags and `package_id` to adjust it correctly and knowing the default one of the compiler to keep the compatibility of packages that do not specify the `cppstd` setting.


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `conans/client/build/cppstd_flags.py`
Content:
```
1 from conans.model.version import Version
2 
3 
4 def available_cppstd_versions(compiler, compiler_version):
5     ret = []
6     stds = ["98", "gnu98", "11", "gnu11", "14",  "gnu14", "17", "gnu17"]
7     for stdver in stds:
8         if cppstd_flag(compiler, compiler_version, stdver):
9             ret.append(stdver)
10     return ret
11 
12 
13 def cppstd_flag(compiler, compiler_version, cppstd):
14     if not compiler or not compiler_version or not cppstd:
15         return ""
16     func = {"gcc": _cppstd_gcc,
17             "clang": _cppstd_clang,
18             "apple-clang": _cppstd_apple_clang,
19             "Visual Studio": _cppstd_visualstudio}.get(str(compiler), None)
20     flag = None
21     if func:
22         flag = func(str(compiler_version), str(cppstd))
23     return flag
24 
25 
26 def cppstd_default(compiler, compiler_version):
27 
28     default = {"gcc": _gcc_cppstd_default(compiler_version),
29                "clang": "gnu++98",
30                "apple-clang": "gnu++98",
31                "Visual Studio": _visual_cppstd_default(compiler_version)}.get(str(compiler), None)
32     return default
33 
34 
35 def _gcc_cppstd_default(compiler_version):
36 
37     return "gnu98" if Version(compiler_version) < "6.1" else "gnu14"
38 
39 
40 def _visual_cppstd_default(compiler_version):
41     if Version(compiler_version) >= "14":  # VS 2015 update 3 only
42         return "14"
43     return None
44 
45 
46 def _cppstd_visualstudio(visual_version, cppstd):
47 
48     v14 = None
49     v17 = None
50 
51     if Version(visual_version) >= "14":
52         v14 = "c++14"
53         v17 = "c++latest"
54     if Version(visual_version) >= "15":
55         v17 = "c++17"
56 
57     flag = {"14": v14, "17": v17}.get(str(cppstd), None)
58     return "/std:%s" % flag if flag else None
59 
60 
61 def _cppstd_apple_clang(clang_version, cppstd):
62     """
63     Inspired in:
64     https://github.com/Kitware/CMake/blob/master/Modules/Compiler/AppleClang-CXX.cmake
65     """
66 
67     v98 = vgnu98 = v11 = vgnu11 = v14 = vgnu14 = v17 = vgnu17 = None
68 
69     if Version(clang_version) >= "4.0":
70         v98 = "c++98"
71         vgnu98 = "gnu++98"
72         v11 = "c++11"
73         vgnu11 = "gnu++11"
74 
75     if Version(clang_version) >= "6.1":
76         v14 = "c++14"
77         vgnu14 = "gnu++14"
78     elif Version(clang_version) >= "5.1":
79         v14 = "c++1y"
80         vgnu14 = "gnu++1y"
81 
82     if Version(clang_version) >= "6.1":
83         v17 = "c++1z"
84         vgnu17 = "gnu++1z"
85 
86     flag = {"98": v98, "gnu98": vgnu98,
87             "11": v11, "gnu11": vgnu11,
88             "14": v14, "gnu14": vgnu14,
89             "17": v17, "gnu17": vgnu17}.get(cppstd, None)
90 
91     return "-std=%s" % flag if flag else None
92 
93 
94 def _cppstd_clang(clang_version, cppstd):
95     """
96     Inspired in:
97     https://github.com/Kitware/CMake/blob/
98     1fe2dc5ef2a1f262b125a2ba6a85f624ce150dd2/Modules/Compiler/Clang-CXX.cmake
99     """
100     v98 = vgnu98 = v11 = vgnu11 = v14 = vgnu14 = v17 = vgnu17 = None
101 
102     if Version(clang_version) >= "2.1":
103         v98 = "c++98"
104         vgnu98 = "gnu++98"
105 
106     if Version(clang_version) >= "3.1":
107         v11 = "c++11"
108         vgnu11 = "gnu++11"
109     elif Version(clang_version) >= "2.1":
110         v11 = "c++0x"
111         vgnu11 = "gnu++0x"
112 
113     if Version(clang_version) >= "3.5":
114         v14 = "c++14"
115         vgnu14 = "gnu++14"
116         v17 = "c++1z"
117         vgnu17 = "gnu++1z"
118     elif Version(clang_version) >= "3.4":
119         v14 = "c++1y"
120         vgnu14 = "gnu++1y"
121 
122     flag = {"98": v98, "gnu98": vgnu98,
123             "11": v11, "gnu11": vgnu11,
124             "14": v14, "gnu14": vgnu14,
125             "17": v17, "gnu17": vgnu17}.get(cppstd, None)
126     return "-std=%s" % flag if flag else None
127 
128 
129 def _cppstd_gcc(gcc_version, cppstd):
130     """https://github.com/Kitware/CMake/blob/master/Modules/Compiler/GNU-CXX.cmake"""
131     # https://gcc.gnu.org/projects/cxx-status.html#cxx98
132     v98 = vgnu98 = v11 = vgnu11 = v14 = vgnu14 = v17 = vgnu17 = None
133 
134     if Version(gcc_version) >= "3.4":
135         v98 = "c++98"
136         vgnu98 = "gnu++98"
137 
138     if Version(gcc_version) >= "4.7":
139         v11 = "c++11"
140         vgnu11 = "gnu++11"
141     elif Version(gcc_version) >= "4.3":
142         v11 = "c++0x"
143         vgnu11 = "gnu++0x"
144 
145     if Version(gcc_version) >= "4.9":
146         v14 = "c++14"
147         vgnu14 = "gnu++14"
148     elif Version(gcc_version) >= "4.8":
149         v14 = "c++1y"
150         vgnu14 = "gnu++1y"
151 
152     if Version(gcc_version) >= "5.1":
153         v17 = "c++1z"
154         vgnu17 = "gnu++1z"
155 
156     flag = {"98": v98, "gnu98": vgnu98,
157             "11": v11, "gnu11": vgnu11,
158             "14": v14, "gnu14": vgnu14,
159             "17": v17, "gnu17": vgnu17}.get(cppstd)
160     return "-std=%s" % flag if flag else None
161
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/conans/client/build/cppstd_flags.py b/conans/client/build/cppstd_flags.py
--- a/conans/client/build/cppstd_flags.py
+++ b/conans/client/build/cppstd_flags.py
@@ -24,16 +24,18 @@
 
 
 def cppstd_default(compiler, compiler_version):
-
     default = {"gcc": _gcc_cppstd_default(compiler_version),
-               "clang": "gnu++98",
-               "apple-clang": "gnu++98",
+               "clang": _clang_cppstd_default(compiler_version),
+               "apple-clang": "gnu98",
                "Visual Studio": _visual_cppstd_default(compiler_version)}.get(str(compiler), None)
     return default
 
 
-def _gcc_cppstd_default(compiler_version):
+def _clang_cppstd_default(compiler_version):
+    return "gnu98" if Version(compiler_version) < "6.0" else "gnu14"
+
 
+def _gcc_cppstd_default(compiler_version):
     return "gnu98" if Version(compiler_version) < "6.1" else "gnu14"
 
 
@@ -113,12 +115,17 @@
     if Version(clang_version) >= "3.5":
         v14 = "c++14"
         vgnu14 = "gnu++14"
-        v17 = "c++1z"
-        vgnu17 = "gnu++1z"
     elif Version(clang_version) >= "3.4":
         v14 = "c++1y"
         vgnu14 = "gnu++1y"
 
+    if Version(clang_version) >= "5":
+        v17 = "c++17"
+        vgnu17 = "gnu++17"
+    elif Version(clang_version) >= "3.5":
+        v17 = "c++1z"
+        vgnu17 = "gnu++1z"
+
     flag = {"98": v98, "gnu98": vgnu98,
             "11": v11, "gnu11": vgnu11,
             "14": v14, "gnu14": vgnu14,

{"golden_diff": "diff --git a/conans/client/build/cppstd_flags.py b/conans/client/build/cppstd_flags.py\n--- a/conans/client/build/cppstd_flags.py\n+++ b/conans/client/build/cppstd_flags.py\n@@ -24,16 +24,18 @@\n \n \n def cppstd_default(compiler, compiler_version):\n-\n     default = {\"gcc\": _gcc_cppstd_default(compiler_version),\n-               \"clang\": \"gnu++98\",\n-               \"apple-clang\": \"gnu++98\",\n+               \"clang\": _clang_cppstd_default(compiler_version),\n+               \"apple-clang\": \"gnu98\",\n                \"Visual Studio\": _visual_cppstd_default(compiler_version)}.get(str(compiler), None)\n     return default\n \n \n-def _gcc_cppstd_default(compiler_version):\n+def _clang_cppstd_default(compiler_version):\n+    return \"gnu98\" if Version(compiler_version) < \"6.0\" else \"gnu14\"\n+\n \n+def _gcc_cppstd_default(compiler_version):\n     return \"gnu98\" if Version(compiler_version) < \"6.1\" else \"gnu14\"\n \n \n@@ -113,12 +115,17 @@\n     if Version(clang_version) >= \"3.5\":\n         v14 = \"c++14\"\n         vgnu14 = \"gnu++14\"\n-        v17 = \"c++1z\"\n-        vgnu17 = \"gnu++1z\"\n     elif Version(clang_version) >= \"3.4\":\n         v14 = \"c++1y\"\n         vgnu14 = \"gnu++1y\"\n \n+    if Version(clang_version) >= \"5\":\n+        v17 = \"c++17\"\n+        vgnu17 = \"gnu++17\"\n+    elif Version(clang_version) >= \"3.5\":\n+        v17 = \"c++1z\"\n+        vgnu17 = \"gnu++1z\"\n+\n     flag = {\"98\": v98, \"gnu98\": vgnu98,\n             \"11\": v11, \"gnu11\": vgnu11,\n             \"14\": v14, \"gnu14\": vgnu14,\n", "issue": "Clang 6.0 implications in cppstd flags\nWe have added to the `settings.yml` clang 6.0, but we have to review the `cppstd` flags and `package_id` to adjust it correctly and knowing the default one of the compiler to keep the compatibility of packages that do not specify the `cppstd` setting.\r\n\n", "before_files": [{"content": "from conans.model.version import Version\n\n\ndef available_cppstd_versions(compiler, compiler_version):\n    ret = []\n    stds = [\"98\", \"gnu98\", \"11\", \"gnu11\", \"14\",  \"gnu14\", \"17\", \"gnu17\"]\n    for stdver in stds:\n        if cppstd_flag(compiler, compiler_version, stdver):\n            ret.append(stdver)\n    return ret\n\n\ndef cppstd_flag(compiler, compiler_version, cppstd):\n    if not compiler or not compiler_version or not cppstd:\n        return \"\"\n    func = {\"gcc\": _cppstd_gcc,\n            \"clang\": _cppstd_clang,\n            \"apple-clang\": _cppstd_apple_clang,\n            \"Visual Studio\": _cppstd_visualstudio}.get(str(compiler), None)\n    flag = None\n    if func:\n        flag = func(str(compiler_version), str(cppstd))\n    return flag\n\n\ndef cppstd_default(compiler, compiler_version):\n\n    default = {\"gcc\": _gcc_cppstd_default(compiler_version),\n               \"clang\": \"gnu++98\",\n               \"apple-clang\": \"gnu++98\",\n               \"Visual Studio\": _visual_cppstd_default(compiler_version)}.get(str(compiler), None)\n    return default\n\n\ndef _gcc_cppstd_default(compiler_version):\n\n    return \"gnu98\" if Version(compiler_version) < \"6.1\" else \"gnu14\"\n\n\ndef _visual_cppstd_default(compiler_version):\n    if Version(compiler_version) >= \"14\":  # VS 2015 update 3 only\n        return \"14\"\n    return None\n\n\ndef _cppstd_visualstudio(visual_version, cppstd):\n\n    v14 = None\n    v17 = None\n\n    if Version(visual_version) >= \"14\":\n        v14 = \"c++14\"\n        v17 = \"c++latest\"\n    if Version(visual_version) >= \"15\":\n        v17 = \"c++17\"\n\n    flag = {\"14\": v14, \"17\": v17}.get(str(cppstd), None)\n    return \"/std:%s\" % flag if flag else None\n\n\ndef _cppstd_apple_clang(clang_version, cppstd):\n    \"\"\"\n    Inspired in:\n    https://github.com/Kitware/CMake/blob/master/Modules/Compiler/AppleClang-CXX.cmake\n    \"\"\"\n\n    v98 = vgnu98 = v11 = vgnu11 = v14 = vgnu14 = v17 = vgnu17 = None\n\n    if Version(clang_version) >= \"4.0\":\n        v98 = \"c++98\"\n        vgnu98 = \"gnu++98\"\n        v11 = \"c++11\"\n        vgnu11 = \"gnu++11\"\n\n    if Version(clang_version) >= \"6.1\":\n        v14 = \"c++14\"\n        vgnu14 = \"gnu++14\"\n    elif Version(clang_version) >= \"5.1\":\n        v14 = \"c++1y\"\n        vgnu14 = \"gnu++1y\"\n\n    if Version(clang_version) >= \"6.1\":\n        v17 = \"c++1z\"\n        vgnu17 = \"gnu++1z\"\n\n    flag = {\"98\": v98, \"gnu98\": vgnu98,\n            \"11\": v11, \"gnu11\": vgnu11,\n            \"14\": v14, \"gnu14\": vgnu14,\n            \"17\": v17, \"gnu17\": vgnu17}.get(cppstd, None)\n\n    return \"-std=%s\" % flag if flag else None\n\n\ndef _cppstd_clang(clang_version, cppstd):\n    \"\"\"\n    Inspired in:\n    https://github.com/Kitware/CMake/blob/\n    1fe2dc5ef2a1f262b125a2ba6a85f624ce150dd2/Modules/Compiler/Clang-CXX.cmake\n    \"\"\"\n    v98 = vgnu98 = v11 = vgnu11 = v14 = vgnu14 = v17 = vgnu17 = None\n\n    if Version(clang_version) >= \"2.1\":\n        v98 = \"c++98\"\n        vgnu98 = \"gnu++98\"\n\n    if Version(clang_version) >= \"3.1\":\n        v11 = \"c++11\"\n        vgnu11 = \"gnu++11\"\n    elif Version(clang_version) >= \"2.1\":\n        v11 = \"c++0x\"\n        vgnu11 = \"gnu++0x\"\n\n    if Version(clang_version) >= \"3.5\":\n        v14 = \"c++14\"\n        vgnu14 = \"gnu++14\"\n        v17 = \"c++1z\"\n        vgnu17 = \"gnu++1z\"\n    elif Version(clang_version) >= \"3.4\":\n        v14 = \"c++1y\"\n        vgnu14 = \"gnu++1y\"\n\n    flag = {\"98\": v98, \"gnu98\": vgnu98,\n            \"11\": v11, \"gnu11\": vgnu11,\n            \"14\": v14, \"gnu14\": vgnu14,\n            \"17\": v17, \"gnu17\": vgnu17}.get(cppstd, None)\n    return \"-std=%s\" % flag if flag else None\n\n\ndef _cppstd_gcc(gcc_version, cppstd):\n    \"\"\"https://github.com/Kitware/CMake/blob/master/Modules/Compiler/GNU-CXX.cmake\"\"\"\n    # https://gcc.gnu.org/projects/cxx-status.html#cxx98\n    v98 = vgnu98 = v11 = vgnu11 = v14 = vgnu14 = v17 = vgnu17 = None\n\n    if Version(gcc_version) >= \"3.4\":\n        v98 = \"c++98\"\n        vgnu98 = \"gnu++98\"\n\n    if Version(gcc_version) >= \"4.7\":\n        v11 = \"c++11\"\n        vgnu11 = \"gnu++11\"\n    elif Version(gcc_version) >= \"4.3\":\n        v11 = \"c++0x\"\n        vgnu11 = \"gnu++0x\"\n\n    if Version(gcc_version) >= \"4.9\":\n        v14 = \"c++14\"\n        vgnu14 = \"gnu++14\"\n    elif Version(gcc_version) >= \"4.8\":\n        v14 = \"c++1y\"\n        vgnu14 = \"gnu++1y\"\n\n    if Version(gcc_version) >= \"5.1\":\n        v17 = \"c++1z\"\n        vgnu17 = \"gnu++1z\"\n\n    flag = {\"98\": v98, \"gnu98\": vgnu98,\n            \"11\": v11, \"gnu11\": vgnu11,\n            \"14\": v14, \"gnu14\": vgnu14,\n            \"17\": v17, \"gnu17\": vgnu17}.get(cppstd)\n    return \"-std=%s\" % flag if flag else None\n", "path": "conans/client/build/cppstd_flags.py"}], "after_files": [{"content": "from conans.model.version import Version\n\n\ndef available_cppstd_versions(compiler, compiler_version):\n    ret = []\n    stds = [\"98\", \"gnu98\", \"11\", \"gnu11\", \"14\",  \"gnu14\", \"17\", \"gnu17\"]\n    for stdver in stds:\n        if cppstd_flag(compiler, compiler_version, stdver):\n            ret.append(stdver)\n    return ret\n\n\ndef cppstd_flag(compiler, compiler_version, cppstd):\n    if not compiler or not compiler_version or not cppstd:\n        return \"\"\n    func = {\"gcc\": _cppstd_gcc,\n            \"clang\": _cppstd_clang,\n            \"apple-clang\": _cppstd_apple_clang,\n            \"Visual Studio\": _cppstd_visualstudio}.get(str(compiler), None)\n    flag = None\n    if func:\n        flag = func(str(compiler_version), str(cppstd))\n    return flag\n\n\ndef cppstd_default(compiler, compiler_version):\n    default = {\"gcc\": _gcc_cppstd_default(compiler_version),\n               \"clang\": _clang_cppstd_default(compiler_version),\n               \"apple-clang\": \"gnu98\",\n               \"Visual Studio\": _visual_cppstd_default(compiler_version)}.get(str(compiler), None)\n    return default\n\n\ndef _clang_cppstd_default(compiler_version):\n    return \"gnu98\" if Version(compiler_version) < \"6.0\" else \"gnu14\"\n\n\ndef _gcc_cppstd_default(compiler_version):\n    return \"gnu98\" if Version(compiler_version) < \"6.1\" else \"gnu14\"\n\n\ndef _visual_cppstd_default(compiler_version):\n    if Version(compiler_version) >= \"14\":  # VS 2015 update 3 only\n        return \"14\"\n    return None\n\n\ndef _cppstd_visualstudio(visual_version, cppstd):\n\n    v14 = None\n    v17 = None\n\n    if Version(visual_version) >= \"14\":\n        v14 = \"c++14\"\n        v17 = \"c++latest\"\n    if Version(visual_version) >= \"15\":\n        v17 = \"c++17\"\n\n    flag = {\"14\": v14, \"17\": v17}.get(str(cppstd), None)\n    return \"/std:%s\" % flag if flag else None\n\n\ndef _cppstd_apple_clang(clang_version, cppstd):\n    \"\"\"\n    Inspired in:\n    https://github.com/Kitware/CMake/blob/master/Modules/Compiler/AppleClang-CXX.cmake\n    \"\"\"\n\n    v98 = vgnu98 = v11 = vgnu11 = v14 = vgnu14 = v17 = vgnu17 = None\n\n    if Version(clang_version) >= \"4.0\":\n        v98 = \"c++98\"\n        vgnu98 = \"gnu++98\"\n        v11 = \"c++11\"\n        vgnu11 = \"gnu++11\"\n\n    if Version(clang_version) >= \"6.1\":\n        v14 = \"c++14\"\n        vgnu14 = \"gnu++14\"\n    elif Version(clang_version) >= \"5.1\":\n        v14 = \"c++1y\"\n        vgnu14 = \"gnu++1y\"\n\n    if Version(clang_version) >= \"6.1\":\n        v17 = \"c++1z\"\n        vgnu17 = \"gnu++1z\"\n\n    flag = {\"98\": v98, \"gnu98\": vgnu98,\n            \"11\": v11, \"gnu11\": vgnu11,\n            \"14\": v14, \"gnu14\": vgnu14,\n            \"17\": v17, \"gnu17\": vgnu17}.get(cppstd, None)\n\n    return \"-std=%s\" % flag if flag else None\n\n\ndef _cppstd_clang(clang_version, cppstd):\n    \"\"\"\n    Inspired in:\n    https://github.com/Kitware/CMake/blob/\n    1fe2dc5ef2a1f262b125a2ba6a85f624ce150dd2/Modules/Compiler/Clang-CXX.cmake\n    \"\"\"\n    v98 = vgnu98 = v11 = vgnu11 = v14 = vgnu14 = v17 = vgnu17 = None\n\n    if Version(clang_version) >= \"2.1\":\n        v98 = \"c++98\"\n        vgnu98 = \"gnu++98\"\n\n    if Version(clang_version) >= \"3.1\":\n        v11 = \"c++11\"\n        vgnu11 = \"gnu++11\"\n    elif Version(clang_version) >= \"2.1\":\n        v11 = \"c++0x\"\n        vgnu11 = \"gnu++0x\"\n\n    if Version(clang_version) >= \"3.5\":\n        v14 = \"c++14\"\n        vgnu14 = \"gnu++14\"\n    elif Version(clang_version) >= \"3.4\":\n        v14 = \"c++1y\"\n        vgnu14 = \"gnu++1y\"\n\n    if Version(clang_version) >= \"5\":\n        v17 = \"c++17\"\n        vgnu17 = \"gnu++17\"\n    elif Version(clang_version) >= \"3.5\":\n        v17 = \"c++1z\"\n        vgnu17 = \"gnu++1z\"\n\n    flag = {\"98\": v98, \"gnu98\": vgnu98,\n            \"11\": v11, \"gnu11\": vgnu11,\n            \"14\": v14, \"gnu14\": vgnu14,\n            \"17\": v17, \"gnu17\": vgnu17}.get(cppstd, None)\n    return \"-std=%s\" % flag if flag else None\n\n\ndef _cppstd_gcc(gcc_version, cppstd):\n    \"\"\"https://github.com/Kitware/CMake/blob/master/Modules/Compiler/GNU-CXX.cmake\"\"\"\n    # https://gcc.gnu.org/projects/cxx-status.html#cxx98\n    v98 = vgnu98 = v11 = vgnu11 = v14 = vgnu14 = v17 = vgnu17 = None\n\n    if Version(gcc_version) >= \"3.4\":\n        v98 = \"c++98\"\n        vgnu98 = \"gnu++98\"\n\n    if Version(gcc_version) >= \"4.7\":\n        v11 = \"c++11\"\n        vgnu11 = \"gnu++11\"\n    elif Version(gcc_version) >= \"4.3\":\n        v11 = \"c++0x\"\n        vgnu11 = \"gnu++0x\"\n\n    if Version(gcc_version) >= \"4.9\":\n        v14 = \"c++14\"\n        vgnu14 = \"gnu++14\"\n    elif Version(gcc_version) >= \"4.8\":\n        v14 = \"c++1y\"\n        vgnu14 = \"gnu++1y\"\n\n    if Version(gcc_version) >= \"5.1\":\n        v17 = \"c++1z\"\n        vgnu17 = \"gnu++1z\"\n\n    flag = {\"98\": v98, \"gnu98\": vgnu98,\n            \"11\": v11, \"gnu11\": vgnu11,\n            \"14\": v14, \"gnu14\": vgnu14,\n            \"17\": v17, \"gnu17\": vgnu17}.get(cppstd)\n    return \"-std=%s\" % flag if flag else None\n", "path": "conans/client/build/cppstd_flags.py"}]}