r333396 - Testing commit access with whitespace change.

2018-05-29 Thread Rafael Stahl via cfe-commits
Author: r.stahl
Date: Tue May 29 01:12:15 2018
New Revision: 96

URL: http://llvm.org/viewvc/llvm-project?rev=96&view=rev
Log:
Testing commit access with whitespace change.


Modified:
cfe/trunk/lib/AST/ASTImporter.cpp

Modified: cfe/trunk/lib/AST/ASTImporter.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTImporter.cpp?rev=96&r1=95&r2=96&view=diff
==
--- cfe/trunk/lib/AST/ASTImporter.cpp (original)
+++ cfe/trunk/lib/AST/ASTImporter.cpp Tue May 29 01:12:15 2018
@@ -128,8 +128,8 @@ namespace clang {
 QualType VisitObjCInterfaceType(const ObjCInterfaceType *T);
 QualType VisitObjCObjectType(const ObjCObjectType *T);
 QualType VisitObjCObjectPointerType(const ObjCObjectPointerType *T);
-
-// Importing declarations
+
+// Importing declarations
 bool ImportDeclParts(NamedDecl *D, DeclContext *&DC, 
  DeclContext *&LexicalDC, DeclarationName &Name, 
  NamedDecl *&ToD, SourceLocation &Loc);


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r333417 - [analyzer] const init: handle non-explicit cases more accurately

2018-05-29 Thread Rafael Stahl via cfe-commits
Author: r.stahl
Date: Tue May 29 07:14:22 2018
New Revision: 333417

URL: http://llvm.org/viewvc/llvm-project?rev=333417&view=rev
Log:
[analyzer] const init: handle non-explicit cases more accurately

Summary: If the access is out of bounds, return UndefinedVal. If it is missing 
an explicit init, return the implicit zero value it must have.

Reviewers: NoQ, xazax.hun, george.karpenkov

Reviewed By: NoQ

Subscribers: szepet, rnkovacs, a.sidorin, cfe-commits

Differential Revision: https://reviews.llvm.org/D46823

Added:
cfe/trunk/test/Analysis/initialization.cpp
Modified:
cfe/trunk/lib/StaticAnalyzer/Core/RegionStore.cpp
cfe/trunk/test/Analysis/initialization.c

Modified: cfe/trunk/lib/StaticAnalyzer/Core/RegionStore.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/RegionStore.cpp?rev=333417&r1=333416&r2=333417&view=diff
==
--- cfe/trunk/lib/StaticAnalyzer/Core/RegionStore.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Core/RegionStore.cpp Tue May 29 07:14:22 2018
@@ -1638,9 +1638,18 @@ SVal RegionStoreManager::getBindingForEl
   // The array index has to be known.
   if (auto CI = R->getIndex().getAs()) {
 int64_t i = CI->getValue().getSExtValue();
-// Return unknown value if index is out of bounds.
-if (i < 0 || i >= InitList->getNumInits())
-  return UnknownVal();
+// If it is known that the index is out of bounds, we can return
+// an undefined value.
+if (i < 0)
+  return UndefinedVal();
+
+if (auto CAT = Ctx.getAsConstantArrayType(VD->getType()))
+  if (CAT->getSize().sle(i))
+return UndefinedVal();
+
+// If there is a list, but no init, it must be zero.
+if (i >= InitList->getNumInits())
+  return svalBuilder.makeZeroVal(R->getElementType());
 
 if (const Expr *ElemInit = InitList->getInit(i))
   if (Optional V = svalBuilder.getConstantVal(ElemInit))
@@ -1715,11 +1724,15 @@ SVal RegionStoreManager::getBindingForFi
 // Either the record variable or the field has to be const qualified.
 if (RecordVarTy.isConstQualified() || Ty.isConstQualified())
   if (const Expr *Init = VD->getInit())
-if (const auto *InitList = dyn_cast(Init))
-  if (Index < InitList->getNumInits())
+if (const auto *InitList = dyn_cast(Init)) {
+  if (Index < InitList->getNumInits()) {
 if (const Expr *FieldInit = InitList->getInit(Index))
   if (Optional V = svalBuilder.getConstantVal(FieldInit))
 return *V;
+  } else {
+return svalBuilder.makeZeroVal(Ty);
+  }
+}
   }
 
   return getBindingForFieldOrElementCommon(B, R, Ty);

Modified: cfe/trunk/test/Analysis/initialization.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/initialization.c?rev=333417&r1=333416&r2=333417&view=diff
==
--- cfe/trunk/test/Analysis/initialization.c (original)
+++ cfe/trunk/test/Analysis/initialization.c Tue May 29 07:14:22 2018
@@ -1,7 +1,28 @@
-// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
-// expected-no-diagnostics
+// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze 
-analyzer-checker=core.builtin,debug.ExprInspection -verify %s
+
+void clang_analyzer_eval(int);
 
 void initbug() {
   const union { float a; } u = {};
   (void)u.a; // no-crash
 }
+
+int const parr[2] = {1};
+void constarr() {
+  int i = 2;
+  clang_analyzer_eval(parr[i]); // expected-warning{{UNDEFINED}}
+  i = 1;
+  clang_analyzer_eval(parr[i] == 0); // expected-warning{{TRUE}}
+  i = -1;
+  clang_analyzer_eval(parr[i]); // expected-warning{{UNDEFINED}}
+}
+
+struct SM {
+  int a;
+  int b;
+};
+const struct SM sm = {.a = 1};
+void multinit() {
+  clang_analyzer_eval(sm.a == 1); // expected-warning{{TRUE}}
+  clang_analyzer_eval(sm.b == 0); // expected-warning{{TRUE}}
+}

Added: cfe/trunk/test/Analysis/initialization.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/initialization.cpp?rev=333417&view=auto
==
--- cfe/trunk/test/Analysis/initialization.cpp (added)
+++ cfe/trunk/test/Analysis/initialization.cpp Tue May 29 07:14:22 2018
@@ -0,0 +1,20 @@
+// RUN: %clang_cc1 -triple i386-apple-darwin10 -analyze 
-analyzer-checker=core.builtin,debug.ExprInspection -verify %s
+
+void clang_analyzer_eval(int);
+
+struct S {
+  int a = 3;
+};
+S const sarr[2] = {};
+void definit() {
+  int i = 1;
+  // FIXME: Should recognize that it is 3.
+  clang_analyzer_eval(sarr[i].a); // expected-warning{{UNKNOWN}}
+}
+
+int const arr[2][2] = {};
+void arr2init() {
+  int i = 1;
+  // FIXME: Should recognize that it is 0.
+  clang_analyzer_eval(arr[i][0]

r358968 - [analyzer][CrossTU] Extend CTU to VarDecls with initializer

2019-04-23 Thread Rafael Stahl via cfe-commits
Author: r.stahl
Date: Tue Apr 23 04:04:41 2019
New Revision: 358968

URL: http://llvm.org/viewvc/llvm-project?rev=358968&view=rev
Log:
[analyzer][CrossTU] Extend CTU to VarDecls with initializer

Summary:
The existing CTU mechanism imports `FunctionDecl`s where the definition is 
available in another TU. This patch extends that to VarDecls, to bind more 
constants.

- Add VarDecl importing functionality to CrossTranslationUnitContext
- Import Decls while traversing them in AnalysisConsumer
- Add VarDecls to CTU external mappings generator
- Name changes from "external function map" to "external definition map"

Reviewers: NoQ, dcoughlin, xazax.hun, george.karpenkov, martong

Reviewed By: xazax.hun

Subscribers: Charusso, baloghadamsoftware, mikhail.ramalho, Szelethus, 
donat.nagy, dkrupp, george.karpenkov, mgorny, whisperity, szepet, rnkovacs, 
a.sidorin, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D46421

Added:
cfe/trunk/test/Analysis/redecl.c
Modified:
cfe/trunk/include/clang/CrossTU/CrossTranslationUnit.h
cfe/trunk/lib/CrossTU/CrossTranslationUnit.cpp
cfe/trunk/lib/StaticAnalyzer/Core/RegionStore.cpp
cfe/trunk/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp
cfe/trunk/test/Analysis/Inputs/ctu-other.cpp
cfe/trunk/test/Analysis/Inputs/ctu-other.cpp.externalDefMap.txt
cfe/trunk/test/Analysis/ctu-main.cpp
cfe/trunk/test/Analysis/func-mapping-test.cpp
cfe/trunk/tools/clang-extdef-mapping/ClangExtDefMapGen.cpp

Modified: cfe/trunk/include/clang/CrossTU/CrossTranslationUnit.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/CrossTU/CrossTranslationUnit.h?rev=358968&r1=358967&r2=358968&view=diff
==
--- cfe/trunk/include/clang/CrossTU/CrossTranslationUnit.h (original)
+++ cfe/trunk/include/clang/CrossTU/CrossTranslationUnit.h Tue Apr 23 04:04:41 
2019
@@ -28,6 +28,7 @@ class ASTImporter;
 class ASTUnit;
 class DeclContext;
 class FunctionDecl;
+class VarDecl;
 class NamedDecl;
 class TranslationUnitDecl;
 
@@ -87,6 +88,9 @@ parseCrossTUIndex(StringRef IndexPath, S
 
 std::string createCrossTUIndexString(const llvm::StringMap 
&Index);
 
+// Returns true if the variable or any field of a record variable is const.
+bool containsConst(const VarDecl *VD, const ASTContext &ACtx);
+
 /// This class is used for tools that requires cross translation
 ///unit capability.
 ///
@@ -102,16 +106,16 @@ public:
   CrossTranslationUnitContext(CompilerInstance &CI);
   ~CrossTranslationUnitContext();
 
-  /// This function loads a function definition from an external AST
-  ///file and merge it into the original AST.
+  /// This function loads a function or variable definition from an
+  ///external AST file and merges it into the original AST.
   ///
-  /// This method should only be used on functions that have no definitions in
+  /// This method should only be used on functions that have no definitions or
+  /// variables that have no initializer in
   /// the current translation unit. A function definition with the same
   /// declaration will be looked up in the index file which should be in the
   /// \p CrossTUDir directory, called \p IndexName. In case the declaration is
   /// found in the index the corresponding AST file will be loaded and the
-  /// definition of the function will be merged into the original AST using
-  /// the AST Importer.
+  /// definition will be merged into the original AST using the AST Importer.
   ///
   /// \return The declaration with the definition will be returned.
   /// If no suitable definition is found in the index file or multiple
@@ -121,17 +125,19 @@ public:
   llvm::Expected
   getCrossTUDefinition(const FunctionDecl *FD, StringRef CrossTUDir,
StringRef IndexName, bool DisplayCTUProgress = false);
+  llvm::Expected
+  getCrossTUDefinition(const VarDecl *VD, StringRef CrossTUDir,
+   StringRef IndexName, bool DisplayCTUProgress = false);
 
-  /// This function loads a function definition from an external AST
-  ///file.
+  /// This function loads a definition from an external AST file.
   ///
-  /// A function definition with the same declaration will be looked up in the
+  /// A definition with the same declaration will be looked up in the
   /// index file which should be in the \p CrossTUDir directory, called
   /// \p IndexName. In case the declaration is found in the index the
   /// corresponding AST file will be loaded.
   ///
   /// \return Returns a pointer to the ASTUnit that contains the definition of
-  /// the looked up function or an Error.
+  /// the looked up name or an Error.
   /// The returned pointer is never a nullptr.
   ///
   /// Note that the AST files should also be in the \p CrossTUDir.
@@ -146,8 +152,9 @@ public:
   ///
   /// \return Returns the resulting definition or an error.
   llvm::Expected importDefinition(con

r365909 - [clang-format][tests] Explicitly specify style in some tests

2019-07-12 Thread Rafael Stahl via cfe-commits
Author: r.stahl
Date: Fri Jul 12 08:56:18 2019
New Revision: 365909

URL: http://llvm.org/viewvc/llvm-project?rev=365909&view=rev
Log:
[clang-format][tests] Explicitly specify style in some tests

Summary: This fixes broken tests when doing an out-of-source build that picks 
up a random .clang-format on the file system due to the default "file" style.

Reviewers: djasper, klimek, MyDeveloperDay, krasimir

Reviewed By: MyDeveloperDay

Subscribers: lebedev.ri, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D61001

Modified:
cfe/trunk/test/Format/adjust-indent.cpp
cfe/trunk/test/Format/disable-include-sorting.cpp
cfe/trunk/test/Format/language-detection.cpp
cfe/trunk/test/Format/xmloutput.cpp

Modified: cfe/trunk/test/Format/adjust-indent.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Format/adjust-indent.cpp?rev=365909&r1=365908&r2=365909&view=diff
==
--- cfe/trunk/test/Format/adjust-indent.cpp (original)
+++ cfe/trunk/test/Format/adjust-indent.cpp Fri Jul 12 08:56:18 2019
@@ -1,4 +1,4 @@
-// RUN: grep -Ev "// *[A-Z-]+:" %s | clang-format -lines=2:2 \
+// RUN: grep -Ev "// *[A-Z-]+:" %s | clang-format -style=LLVM -lines=2:2 \
 // RUN:   | FileCheck -strict-whitespace %s
 
 void  f() {

Modified: cfe/trunk/test/Format/disable-include-sorting.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Format/disable-include-sorting.cpp?rev=365909&r1=365908&r2=365909&view=diff
==
--- cfe/trunk/test/Format/disable-include-sorting.cpp (original)
+++ cfe/trunk/test/Format/disable-include-sorting.cpp Fri Jul 12 08:56:18 2019
@@ -1,4 +1,4 @@
-// RUN: clang-format %s | FileCheck %s
+// RUN: clang-format %s -style=LLVM | FileCheck %s
 // RUN: clang-format %s -sort-includes -style="{SortIncludes: false}" | 
FileCheck %s
 // RUN: clang-format %s -sort-includes=false | FileCheck %s 
-check-prefix=NOT-SORTED
 

Modified: cfe/trunk/test/Format/language-detection.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Format/language-detection.cpp?rev=365909&r1=365908&r2=365909&view=diff
==
--- cfe/trunk/test/Format/language-detection.cpp (original)
+++ cfe/trunk/test/Format/language-detection.cpp Fri Jul 12 08:56:18 2019
@@ -1,8 +1,8 @@
 // RUN: grep -Ev "// *[A-Z0-9_]+:" %s \
-// RUN:   | clang-format -style=llvm -assume-filename=foo.js \
+// RUN:   | clang-format -style=LLVM -assume-filename=foo.js \
 // RUN:   | FileCheck -strict-whitespace -check-prefix=CHECK1 %s
 // RUN: grep -Ev "// *[A-Z0-9_]+:" %s \
-// RUN:   | clang-format -style=llvm -assume-filename=foo.cpp \
+// RUN:   | clang-format -style=LLVM -assume-filename=foo.cpp \
 // RUN:   | FileCheck -strict-whitespace -check-prefix=CHECK2 %s
 // CHECK1: {{^a >>>= b;$}}
 // CHECK2: {{^a >> >= b;$}}

Modified: cfe/trunk/test/Format/xmloutput.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Format/xmloutput.cpp?rev=365909&r1=365908&r2=365909&view=diff
==
--- cfe/trunk/test/Format/xmloutput.cpp (original)
+++ cfe/trunk/test/Format/xmloutput.cpp Fri Jul 12 08:56:18 2019
@@ -1,4 +1,4 @@
-// RUN: clang-format -output-replacements-xml -sort-includes %s \
+// RUN: clang-format -style=LLVM -output-replacements-xml -sort-includes %s \
 // RUN:   | FileCheck -strict-whitespace %s
 
 // CHECK: https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r367219 - doc: Fix Google C++ Style Guide link.

2019-07-29 Thread Rafael Stahl via cfe-commits
Author: r.stahl
Date: Mon Jul 29 04:00:23 2019
New Revision: 367219

URL: http://llvm.org/viewvc/llvm-project?rev=367219&view=rev
Log:
doc: Fix Google C++ Style Guide link.

Modified:
cfe/trunk/docs/ClangFormatStyleOptions.rst

Modified: cfe/trunk/docs/ClangFormatStyleOptions.rst
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/ClangFormatStyleOptions.rst?rev=367219&r1=367218&r2=367219&view=diff
==
--- cfe/trunk/docs/ClangFormatStyleOptions.rst (original)
+++ cfe/trunk/docs/ClangFormatStyleOptions.rst Mon Jul 29 04:00:23 2019
@@ -138,7 +138,7 @@ the configuration (without a prefix: ``A
 `_
   * ``Google``
 A style complying with `Google's C++ style guide
-`_
+`_
   * ``Chromium``
 A style complying with `Chromium's style guide
 `_


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r350528 - [analyzer] Pass the correct loc Expr from VisitIncDecOp to evalStore

2019-01-07 Thread Rafael Stahl via cfe-commits
Author: r.stahl
Date: Mon Jan  7 07:07:01 2019
New Revision: 350528

URL: http://llvm.org/viewvc/llvm-project?rev=350528&view=rev
Log:
[analyzer] Pass the correct loc Expr from VisitIncDecOp to evalStore

Summary: The LocationE parameter of evalStore is documented as "The location 
expression that is stored to". When storing from an increment / decrement 
operator this was not satisfied. In user code this causes an inconsistency 
between the SVal and Stmt parameters of checkLocation.

Reviewers: NoQ, dcoughlin, george.karpenkov

Reviewed By: NoQ

Subscribers: xazax.hun, baloghadamsoftware, szepet, a.sidorin, mikhail.ramalho, 
Szelethus, donat.nagy, dkrupp, cfe-commits

Differential Revision: https://reviews.llvm.org/D55701

Modified:
cfe/trunk/lib/StaticAnalyzer/Core/ExprEngineC.cpp
cfe/trunk/unittests/StaticAnalyzer/RegisterCustomCheckersTest.cpp

Modified: cfe/trunk/lib/StaticAnalyzer/Core/ExprEngineC.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/ExprEngineC.cpp?rev=350528&r1=350527&r2=350528&view=diff
==
--- cfe/trunk/lib/StaticAnalyzer/Core/ExprEngineC.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Core/ExprEngineC.cpp Mon Jan  7 07:07:01 2019
@@ -1052,7 +1052,7 @@ void ExprEngine::VisitIncrementDecrement
   // Perform the store, so that the uninitialized value detection happens.
   Bldr.takeNodes(*I);
   ExplodedNodeSet Dst3;
-  evalStore(Dst3, U, U, *I, state, loc, V2_untested);
+  evalStore(Dst3, U, Ex, *I, state, loc, V2_untested);
   Bldr.addNodes(Dst3);
 
   continue;
@@ -1120,7 +1120,7 @@ void ExprEngine::VisitIncrementDecrement
 // Perform the store.
 Bldr.takeNodes(*I);
 ExplodedNodeSet Dst3;
-evalStore(Dst3, U, U, *I, state, loc, Result);
+evalStore(Dst3, U, Ex, *I, state, loc, Result);
 Bldr.addNodes(Dst3);
   }
   Dst.insert(Dst2);

Modified: cfe/trunk/unittests/StaticAnalyzer/RegisterCustomCheckersTest.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/StaticAnalyzer/RegisterCustomCheckersTest.cpp?rev=350528&r1=350527&r2=350528&view=diff
==
--- cfe/trunk/unittests/StaticAnalyzer/RegisterCustomCheckersTest.cpp (original)
+++ cfe/trunk/unittests/StaticAnalyzer/RegisterCustomCheckersTest.cpp Mon Jan  
7 07:07:01 2019
@@ -21,16 +21,7 @@ namespace clang {
 namespace ento {
 namespace {
 
-class CustomChecker : public Checker {
-public:
-  void checkASTCodeBody(const Decl *D, AnalysisManager &Mgr,
-BugReporter &BR) const {
-BR.EmitBasicReport(D, this, "Custom diagnostic", categories::LogicError,
-   "Custom diagnostic description",
-   PathDiagnosticLocation(D, Mgr.getSourceManager()), {});
-  }
-};
-
+template 
 class TestAction : public ASTFrontendAction {
   class DiagConsumer : public PathDiagnosticConsumer {
 llvm::raw_ostream &Output;
@@ -59,23 +50,55 @@ public:
 Compiler.getAnalyzerOpts()->CheckersControlList = {
 {"custom.CustomChecker", true}};
 AnalysisConsumer->AddCheckerRegistrationFn([](CheckerRegistry &Registry) {
-  Registry.addChecker("custom.CustomChecker", "Description",
- "");
+  Registry.addChecker("custom.CustomChecker", "Description", "");
 });
 return std::move(AnalysisConsumer);
   }
 };
 
+template 
+bool runCheckerOnCode(const std::string &Code, std::string &Diags) {
+  llvm::raw_string_ostream OS(Diags);
+  return tooling::runToolOnCode(new TestAction(OS), Code);
+}
+template 
+bool runCheckerOnCode(const std::string &Code) {
+  std::string Diags;
+  return runCheckerOnCode(Code, Diags);
+}
+
+
+class CustomChecker : public Checker {
+public:
+  void checkASTCodeBody(const Decl *D, AnalysisManager &Mgr,
+BugReporter &BR) const {
+BR.EmitBasicReport(D, this, "Custom diagnostic", categories::LogicError,
+   "Custom diagnostic description",
+   PathDiagnosticLocation(D, Mgr.getSourceManager()), {});
+  }
+};
 
 TEST(RegisterCustomCheckers, RegisterChecker) {
   std::string Diags;
-  {
-llvm::raw_string_ostream OS(Diags);
-EXPECT_TRUE(tooling::runToolOnCode(new TestAction(OS), "void f() {;}"));
-  }
+  EXPECT_TRUE(runCheckerOnCode("void f() {;}", Diags));
   EXPECT_EQ(Diags, "custom.CustomChecker:Custom diagnostic description");
 }
 
+class LocIncDecChecker : public Checker {
+public:
+  void checkLocation(SVal Loc, bool IsLoad, const Stmt *S,
+ CheckerContext &C) const {
+auto UnaryOp = dyn_cast(S);
+if (UnaryOp && !IsLoad)
+  EXPECT_FALSE(UnaryOp->isIncrementOp());
+  }
+};
+
+TEST(RegisterCustomCheckers, CheckLocationIncDec) {
+  EXPECT_TRUE(
+  runCheckerOnCode("void f() { int *p; (*p)++; }"));
+}
+
 }
 }
 }


___
cfe

r350852 - [analyzer][CrossTU][NFC] Generalize to external definitions instead of external functions

2019-01-10 Thread Rafael Stahl via cfe-commits
Author: r.stahl
Date: Thu Jan 10 09:44:04 2019
New Revision: 350852

URL: http://llvm.org/viewvc/llvm-project?rev=350852&view=rev
Log:
[analyzer][CrossTU][NFC] Generalize to external definitions instead of external 
functions

Summary: This is just changing naming and documentation to be general about 
external definitions that can be imported for cross translation unit analysis. 
There is at least a plan to add VarDecls: D46421

Reviewers: NoQ, xazax.hun, martong, a.sidorin, george.karpenkov, 
serge-sans-paille

Reviewed By: xazax.hun, martong

Subscribers: mgorny, whisperity, baloghadamsoftware, szepet, rnkovacs, 
mikhail.ramalho, Szelethus, donat.nagy, dkrupp, cfe-commits

Differential Revision: https://reviews.llvm.org/D56441

Added:
cfe/trunk/test/Analysis/Inputs/ctu-other.c.externalDefMap.txt   (props 
changed)
  - copied unchanged from r350851, 
cfe/trunk/test/Analysis/Inputs/ctu-other.c.externalFnMap.txt
cfe/trunk/test/Analysis/Inputs/ctu-other.cpp.externalDefMap.txt   (props 
changed)
  - copied unchanged from r350851, 
cfe/trunk/test/Analysis/Inputs/ctu-other.cpp.externalFnMap.txt
cfe/trunk/tools/clang-extdef-mapping/
cfe/trunk/tools/clang-extdef-mapping/CMakeLists.txt   (contents, props 
changed)
  - copied, changed from r350851, 
cfe/trunk/tools/clang-func-mapping/CMakeLists.txt
cfe/trunk/tools/clang-extdef-mapping/ClangExtDefMapGen.cpp   (contents, 
props changed)
  - copied, changed from r350851, 
cfe/trunk/tools/clang-func-mapping/ClangFnMapGen.cpp
Removed:
cfe/trunk/test/Analysis/Inputs/ctu-other.c.externalFnMap.txt
cfe/trunk/test/Analysis/Inputs/ctu-other.cpp.externalFnMap.txt
cfe/trunk/tools/clang-func-mapping/CMakeLists.txt
cfe/trunk/tools/clang-func-mapping/ClangFnMapGen.cpp
Modified:
cfe/trunk/include/clang/Basic/DiagnosticCrossTUKinds.td
cfe/trunk/include/clang/CrossTU/CrossTranslationUnit.h
cfe/trunk/include/clang/StaticAnalyzer/Core/AnalyzerOptions.def
cfe/trunk/lib/CrossTU/CrossTranslationUnit.cpp
cfe/trunk/test/Analysis/analyzer-config.c
cfe/trunk/test/Analysis/ctu-different-triples.cpp
cfe/trunk/test/Analysis/ctu-main.c
cfe/trunk/test/Analysis/ctu-main.cpp
cfe/trunk/test/Analysis/ctu-unknown-parts-in-triples.cpp
cfe/trunk/test/Analysis/func-mapping-test.cpp
cfe/trunk/test/CMakeLists.txt
cfe/trunk/test/lit.cfg.py
cfe/trunk/tools/CMakeLists.txt
cfe/trunk/tools/scan-build-py/README.md
cfe/trunk/tools/scan-build-py/libscanbuild/__init__.py
cfe/trunk/tools/scan-build-py/libscanbuild/analyze.py
cfe/trunk/tools/scan-build-py/libscanbuild/arguments.py
cfe/trunk/tools/scan-build-py/libscanbuild/clang.py
cfe/trunk/tools/scan-build-py/tests/unit/test_analyze.py
cfe/trunk/tools/scan-build-py/tests/unit/test_clang.py

Modified: cfe/trunk/include/clang/Basic/DiagnosticCrossTUKinds.td
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticCrossTUKinds.td?rev=350852&r1=350851&r2=350852&view=diff
==
--- cfe/trunk/include/clang/Basic/DiagnosticCrossTUKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticCrossTUKinds.td Thu Jan 10 09:44:04 
2019
@@ -12,7 +12,7 @@ let Component = "CrossTU" in {
 def err_ctu_error_opening : Error<
   "error opening '%0': required by the CrossTU functionality">;
 
-def err_fnmap_parsing : Error<
+def err_extdefmap_parsing : Error<
   "error parsing index file: '%0' line: %1 'UniqueID filename' format "
   "expected">;
 

Modified: cfe/trunk/include/clang/CrossTU/CrossTranslationUnit.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/CrossTU/CrossTranslationUnit.h?rev=350852&r1=350851&r2=350852&view=diff
==
--- cfe/trunk/include/clang/CrossTU/CrossTranslationUnit.h (original)
+++ cfe/trunk/include/clang/CrossTU/CrossTranslationUnit.h Thu Jan 10 09:44:04 
2019
@@ -90,11 +90,11 @@ std::string createCrossTUIndexString(con
 /// This class is used for tools that requires cross translation
 ///unit capability.
 ///
-/// This class can load function definitions from external AST files.
+/// This class can load definitions from external AST files.
 /// The loaded definition will be merged back to the original AST using the
 /// AST Importer.
 /// In order to use this class, an index file is required that describes
-/// the locations of the AST files for each function definition.
+/// the locations of the AST files for each definition.
 ///
 /// Note that this class also implements caching.
 class CrossTranslationUnitContext {

Modified: cfe/trunk/include/clang/StaticAnalyzer/Core/AnalyzerOptions.def
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/StaticAnalyzer/Core/AnalyzerOptions.def?rev=350852&r1=350851&r2=350852&view=diff
==
--- cfe/trunk/in

r336269 - [ASTImporter] import macro source locations

2018-07-04 Thread Rafael Stahl via cfe-commits
Author: r.stahl
Date: Wed Jul  4 06:34:05 2018
New Revision: 336269

URL: http://llvm.org/viewvc/llvm-project?rev=336269&view=rev
Log:
[ASTImporter] import macro source locations

Summary: Implement full import of macro expansion info with spelling and 
expansion locations.

Reviewers: a.sidorin, klimek, martong, balazske, xazax.hun

Reviewed By: martong

Subscribers: thakis, xazax.hun, balazske, rnkovacs, cfe-commits

Differential Revision: https://reviews.llvm.org/D47698

Modified:
cfe/trunk/lib/AST/ASTImporter.cpp
cfe/trunk/unittests/AST/ASTImporterTest.cpp

Modified: cfe/trunk/lib/AST/ASTImporter.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTImporter.cpp?rev=336269&r1=336268&r2=336269&view=diff
==
--- cfe/trunk/lib/AST/ASTImporter.cpp (original)
+++ cfe/trunk/lib/AST/ASTImporter.cpp Wed Jul  4 06:34:05 2018
@@ -7164,19 +7164,13 @@ SourceLocation ASTImporter::Import(Sourc
 return {};
 
   SourceManager &FromSM = FromContext.getSourceManager();
-  
-  // For now, map everything down to its file location, so that we
-  // don't have to import macro expansions.
-  // FIXME: Import macro expansions!
-  FromLoc = FromSM.getFileLoc(FromLoc);
+
   std::pair Decomposed = FromSM.getDecomposedLoc(FromLoc);
-  SourceManager &ToSM = ToContext.getSourceManager();
   FileID ToFileID = Import(Decomposed.first);
   if (ToFileID.isInvalid())
 return {};
-  SourceLocation ret = ToSM.getLocForStartOfFile(ToFileID)
-   .getLocWithOffset(Decomposed.second);
-  return ret;
+  SourceManager &ToSM = ToContext.getSourceManager();
+  return ToSM.getComposedLoc(ToFileID, Decomposed.second);
 }
 
 SourceRange ASTImporter::Import(SourceRange FromRange) {
@@ -7184,41 +7178,56 @@ SourceRange ASTImporter::Import(SourceRa
 }
 
 FileID ASTImporter::Import(FileID FromID) {
-  llvm::DenseMap::iterator Pos
-= ImportedFileIDs.find(FromID);
+  llvm::DenseMap::iterator Pos = ImportedFileIDs.find(FromID);
   if (Pos != ImportedFileIDs.end())
 return Pos->second;
-  
+
   SourceManager &FromSM = FromContext.getSourceManager();
   SourceManager &ToSM = ToContext.getSourceManager();
   const SrcMgr::SLocEntry &FromSLoc = FromSM.getSLocEntry(FromID);
-  assert(FromSLoc.isFile() && "Cannot handle macro expansions yet");
-  
-  // Include location of this file.
-  SourceLocation ToIncludeLoc = Import(FromSLoc.getFile().getIncludeLoc());
-  
-  // Map the FileID for to the "to" source manager.
+
+  // Map the FromID to the "to" source manager.
   FileID ToID;
-  const SrcMgr::ContentCache *Cache = FromSLoc.getFile().getContentCache();
-  if (Cache->OrigEntry && Cache->OrigEntry->getDir()) {
-// FIXME: We probably want to use getVirtualFile(), so we don't hit the
-// disk again
-// FIXME: We definitely want to re-use the existing MemoryBuffer, rather
-// than mmap the files several times.
-const FileEntry *Entry = 
ToFileManager.getFile(Cache->OrigEntry->getName());
-if (!Entry)
-  return {};
-ToID = ToSM.createFileID(Entry, ToIncludeLoc, 
- FromSLoc.getFile().getFileCharacteristic());
+  if (FromSLoc.isExpansion()) {
+const SrcMgr::ExpansionInfo &FromEx = FromSLoc.getExpansion();
+SourceLocation ToSpLoc = Import(FromEx.getSpellingLoc());
+SourceLocation ToExLocS = Import(FromEx.getExpansionLocStart());
+unsigned TokenLen = FromSM.getFileIDSize(FromID);
+SourceLocation MLoc;
+if (FromEx.isMacroArgExpansion()) {
+  MLoc = ToSM.createMacroArgExpansionLoc(ToSpLoc, ToExLocS, TokenLen);
+} else {
+  SourceLocation ToExLocE = Import(FromEx.getExpansionLocEnd());
+  MLoc = ToSM.createExpansionLoc(ToSpLoc, ToExLocS, ToExLocE, TokenLen,
+ FromEx.isExpansionTokenRange());
+}
+ToID = ToSM.getFileID(MLoc);
   } else {
-// FIXME: We want to re-use the existing MemoryBuffer!
-const llvm::MemoryBuffer *
-FromBuf = Cache->getBuffer(FromContext.getDiagnostics(), FromSM);
-std::unique_ptr ToBuf
-  = llvm::MemoryBuffer::getMemBufferCopy(FromBuf->getBuffer(),
- FromBuf->getBufferIdentifier());
-ToID = ToSM.createFileID(std::move(ToBuf),
- FromSLoc.getFile().getFileCharacteristic());
+// Include location of this file.
+SourceLocation ToIncludeLoc = Import(FromSLoc.getFile().getIncludeLoc());
+
+const SrcMgr::ContentCache *Cache = FromSLoc.getFile().getContentCache();
+if (Cache->OrigEntry && Cache->OrigEntry->getDir()) {
+  // FIXME: We probably want to use getVirtualFile(), so we don't hit the
+  // disk again
+  // FIXME: We definitely want to re-use the existing MemoryBuffer, rather
+  // than mmap the files several times.
+  const FileEntry *Entry =
+  ToFileManager.getFile(Cache->OrigEntry->getName());
+  if (!Entry)
+return {};
+

r336275 - [analyzer][ctu] fix unsortable diagnostics

2018-07-04 Thread Rafael Stahl via cfe-commits
Author: r.stahl
Date: Wed Jul  4 07:12:58 2018
New Revision: 336275

URL: http://llvm.org/viewvc/llvm-project?rev=336275&view=rev
Log:
[analyzer][ctu] fix unsortable diagnostics

Summary: In the provided test case the PathDiagnostic compare function was not 
able to find a difference.

Reviewers: xazax.hun, NoQ, dcoughlin, george.karpenkov

Reviewed By: george.karpenkov

Subscribers: a_sidorin, szepet, rnkovacs, a.sidorin, mikhail.ramalho, 
cfe-commits

Differential Revision: https://reviews.llvm.org/D48474

Added:
cfe/trunk/test/Analysis/ctu-hdr.h
Modified:
cfe/trunk/lib/StaticAnalyzer/Core/PathDiagnostic.cpp
cfe/trunk/test/Analysis/Inputs/ctu-other.cpp
cfe/trunk/test/Analysis/Inputs/externalFnMap.txt
cfe/trunk/test/Analysis/ctu-main.cpp

Modified: cfe/trunk/lib/StaticAnalyzer/Core/PathDiagnostic.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/PathDiagnostic.cpp?rev=336275&r1=336274&r2=336275&view=diff
==
--- cfe/trunk/lib/StaticAnalyzer/Core/PathDiagnostic.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Core/PathDiagnostic.cpp Wed Jul  4 07:12:58 
2018
@@ -406,11 +406,15 @@ static bool compareCrossTUSourceLocs(Ful
   std::pair InSameTU = SM.isInTheSameTranslationUnit(XOffs, YOffs);
   if (InSameTU.first)
 return XL.isBeforeInTranslationUnitThan(YL);
-  const FileEntry *XFE = SM.getFileEntryForID(XL.getFileID());
-  const FileEntry *YFE = SM.getFileEntryForID(YL.getFileID());
+  const FileEntry *XFE = SM.getFileEntryForID(XL.getSpellingLoc().getFileID());
+  const FileEntry *YFE = SM.getFileEntryForID(YL.getSpellingLoc().getFileID());
   if (!XFE || !YFE)
 return XFE && !YFE;
-  return XFE->getName() < YFE->getName();
+  int NameCmp = XFE->getName().compare(YFE->getName());
+  if (NameCmp != 0)
+return NameCmp == -1;
+  // Last resort: Compare raw file IDs that are possibly expansions.
+  return XL.getFileID() < YL.getFileID();
 }
 
 static bool compare(const PathDiagnostic &X, const PathDiagnostic &Y) {

Modified: cfe/trunk/test/Analysis/Inputs/ctu-other.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/Inputs/ctu-other.cpp?rev=336275&r1=336274&r2=336275&view=diff
==
--- cfe/trunk/test/Analysis/Inputs/ctu-other.cpp (original)
+++ cfe/trunk/test/Analysis/Inputs/ctu-other.cpp Wed Jul  4 07:12:58 2018
@@ -1,3 +1,5 @@
+#include "../ctu-hdr.h"
+
 int callback_to_main(int x);
 int f(int x) {
   return x - 1;
@@ -68,3 +70,8 @@ int chf1(int x) {
 
 typedef struct { int n; } Anonymous;
 int fun_using_anon_struct(int n) { Anonymous anon; anon.n = n; return anon.n; }
+
+int other_macro_diag(int x) {
+  MACRODIAG();
+  return x;
+}

Modified: cfe/trunk/test/Analysis/Inputs/externalFnMap.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/Inputs/externalFnMap.txt?rev=336275&r1=336274&r2=336275&view=diff
==
--- cfe/trunk/test/Analysis/Inputs/externalFnMap.txt (original)
+++ cfe/trunk/test/Analysis/Inputs/externalFnMap.txt Wed Jul  4 07:12:58 2018
@@ -12,3 +12,4 @@ c:@F@h_chain#I# ctu-chain.cpp.ast
 c:@N@chns@S@chcls@F@chf4#I# ctu-chain.cpp.ast
 c:@N@chns@F@chf2#I# ctu-chain.cpp.ast
 c:@F@fun_using_anon_struct#I# ctu-other.cpp.ast
+c:@F@other_macro_diag#I# ctu-other.cpp.ast

Added: cfe/trunk/test/Analysis/ctu-hdr.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/ctu-hdr.h?rev=336275&view=auto
==
--- cfe/trunk/test/Analysis/ctu-hdr.h (added)
+++ cfe/trunk/test/Analysis/ctu-hdr.h Wed Jul  4 07:12:58 2018
@@ -0,0 +1,3 @@
+#define MACRODIAG() clang_analyzer_warnIfReached()
+
+void clang_analyzer_warnIfReached();

Modified: cfe/trunk/test/Analysis/ctu-main.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/ctu-main.cpp?rev=336275&r1=336274&r2=336275&view=diff
==
--- cfe/trunk/test/Analysis/ctu-main.cpp (original)
+++ cfe/trunk/test/Analysis/ctu-main.cpp Wed Jul  4 07:12:58 2018
@@ -4,6 +4,8 @@
 // RUN: cp %S/Inputs/externalFnMap.txt %T/ctudir/
 // RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -fsyntax-only -analyze 
-analyzer-checker=core,debug.ExprInspection -analyzer-config 
experimental-enable-naive-ctu-analysis=true -analyzer-config ctu-dir=%T/ctudir 
-verify %s
 
+#include "ctu-hdr.h"
+
 void clang_analyzer_eval(int);
 
 int f(int);
@@ -41,6 +43,7 @@ int chf1(int x);
 }
 
 int fun_using_anon_struct(int);
+int other_macro_diag(int);
 
 int main() {
   clang_analyzer_eval(f(3) == 2); // expected-warning{{TRUE}}
@@ -58,4 +61,8 @@ int main() {
 
   clang_analyzer_eval(chns::chf1(4) == 12); // expected-warning{{TRUE}}
   clang_analyzer_eval(fun_using_anon_struct(8) == 8); // 
expected-warning{{TRUE}}
+
+  clang_analy

r336523 - [ASTImporter] import FunctionDecl end locations

2018-07-09 Thread Rafael Stahl via cfe-commits
Author: r.stahl
Date: Mon Jul  9 01:40:17 2018
New Revision: 336523

URL: http://llvm.org/viewvc/llvm-project?rev=336523&view=rev
Log:
[ASTImporter] import FunctionDecl end locations

Summary: On constructors that do not take the end source location, it was not 
imported. Fixes test from D47698 / rC336269.

Reviewers: martong, a.sidorin, balazske, xazax.hun, a_sidorin

Reviewed By: martong, a_sidorin

Subscribers: a_sidorin, rnkovacs, cfe-commits

Differential Revision: https://reviews.llvm.org/D48941

Modified:
cfe/trunk/lib/AST/ASTImporter.cpp
cfe/trunk/unittests/AST/ASTImporterTest.cpp

Modified: cfe/trunk/lib/AST/ASTImporter.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTImporter.cpp?rev=336523&r1=336522&r2=336523&view=diff
==
--- cfe/trunk/lib/AST/ASTImporter.cpp (original)
+++ cfe/trunk/lib/AST/ASTImporter.cpp Mon Jul  9 01:40:17 2018
@@ -2554,7 +2554,7 @@ Decl *ASTNodeImporter::VisitFunctionDecl
D->isInlineSpecified(),
FromConversion->isExplicit(),
D->isConstexpr(),
-   Importer.Import(D->getLocEnd()));
+   SourceLocation());
   } else if (auto *Method = dyn_cast(D)) {
 ToFunction = CXXMethodDecl::Create(Importer.getToContext(), 
cast(DC),
@@ -2563,7 +2563,7 @@ Decl *ASTNodeImporter::VisitFunctionDecl
Method->getStorageClass(),
Method->isInlineSpecified(),
D->isConstexpr(),
-   Importer.Import(D->getLocEnd()));
+   SourceLocation());
   } else {
 ToFunction = FunctionDecl::Create(Importer.getToContext(), DC,
   InnerLocStart,
@@ -2580,6 +2580,7 @@ Decl *ASTNodeImporter::VisitFunctionDecl
   ToFunction->setVirtualAsWritten(D->isVirtualAsWritten());
   ToFunction->setTrivial(D->isTrivial());
   ToFunction->setPure(D->isPure());
+  ToFunction->setRangeEnd(Importer.Import(D->getLocEnd()));
   Importer.Imported(D, ToFunction);
 
   // Set the parameters.

Modified: cfe/trunk/unittests/AST/ASTImporterTest.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/AST/ASTImporterTest.cpp?rev=336523&r1=336522&r2=336523&view=diff
==
--- cfe/trunk/unittests/AST/ASTImporterTest.cpp (original)
+++ cfe/trunk/unittests/AST/ASTImporterTest.cpp Mon Jul  9 01:40:17 2018
@@ -1620,7 +1620,7 @@ TEST_P(ASTImporterTestBase, ImportSource
   FromSM);
 }
 
-TEST_P(ASTImporterTestBase, DISABLED_ImportNestedMacro) {
+TEST_P(ASTImporterTestBase, ImportNestedMacro) {
   Decl *FromTU = getTuDecl(
   R"(
   #define FUNC_INT void declToImport


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r336527 - [ASTImporter] fix test failure corrected by fixed func end locs

2018-07-09 Thread Rafael Stahl via cfe-commits
Author: r.stahl
Date: Mon Jul  9 02:02:53 2018
New Revision: 336527

URL: http://llvm.org/viewvc/llvm-project?rev=336527&view=rev
Log:
[ASTImporter] fix test failure corrected by fixed func end locs

fix to rC336523 / D48941


Modified:
cfe/trunk/test/Import/attr/test.cpp

Modified: cfe/trunk/test/Import/attr/test.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Import/attr/test.cpp?rev=336527&r1=336526&r2=336527&view=diff
==
--- cfe/trunk/test/Import/attr/test.cpp (original)
+++ cfe/trunk/test/Import/attr/test.cpp Mon Jul  9 02:02:53 2018
@@ -1,6 +1,6 @@
 // RUN: clang-import-test -dump-ast -import %S/Inputs/S.cpp -expression %s | 
FileCheck %s
 // CHECK: FunctionDecl
-// CHECK-SAME: S.cpp:1:1, col:13
+// CHECK-SAME: S.cpp:1:1, col:38
 // CHECK-NEXT: ConstAttr
 // CHECK-SAME: col:32
 


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] [clang-tidy][NFC] Fix gsl::not_null template parameter (PR #99472)

2024-07-18 Thread Rafael Stahl via cfe-commits

https://github.com/rafzi created https://github.com/llvm/llvm-project/pull/99472

`T` is expected to be a pointer type.

https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rf-nullptr

>From 48e452b9032d26889dfceb7668159275015a5290 Mon Sep 17 00:00:00 2001
From: Rafael Stahl 
Date: Thu, 18 Jul 2024 13:35:28 +0200
Subject: [PATCH] [clang-tidy][NFC] Fix gsl::not_null template parameter

---
 .../cppcoreguidelines/avoid-const-or-ref-data-members.rst | 2 +-
 .../cppcoreguidelines/avoid-const-or-ref-data-members.cpp | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git 
a/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines/avoid-const-or-ref-data-members.rst
 
b/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines/avoid-const-or-ref-data-members.rst
index 5783280478dc1..57c4829431e76 100644
--- 
a/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines/avoid-const-or-ref-data-members.rst
+++ 
b/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines/avoid-const-or-ref-data-members.rst
@@ -35,7 +35,7 @@ Examples:
 int* x;
 std::unique_ptr x;
 std::shared_ptr x;
-gsl::not_null x;
+gsl::not_null x;
   };
 
   // Bad, rvalue reference member
diff --git 
a/clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/avoid-const-or-ref-data-members.cpp
 
b/clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/avoid-const-or-ref-data-members.cpp
index 5a5d05bb4e94e..e3864be134da3 100644
--- 
a/clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/avoid-const-or-ref-data-members.cpp
+++ 
b/clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/avoid-const-or-ref-data-members.cpp
@@ -18,7 +18,7 @@ struct Ok {
   const int *pc;
   std::unique_ptr up;
   std::shared_ptr sp;
-  gsl::not_null n;
+  gsl::not_null n;
 };
 
 struct ConstMember {
@@ -60,7 +60,7 @@ struct Ok2 {
   const Foo *pc;
   std::unique_ptr up;
   std::shared_ptr sp;
-  gsl::not_null n;
+  gsl::not_null n;
 };
 
 struct ConstMember2 {

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits